Results 1 to 5 of 5

Thread: Slow Performance with a simple query in a small table?

  1. #1
    TH Guest

    Slow Performance with a simple query in a small table?


    In my database/MY SERVER (SQL7/Win2K), I run a simple query with a Table/10000 rows (without cluster index):
    SELECT * FROM TABLE
    it take over 30s. Why it's slow? How can I check for reason? How to configure my server to improve performance?
    Thanks in advance.
    TH
    ----------------------------------
    SP_CONFIGURE's RESULT in MY SERVER
    ----------------------------------

    Table 'spt_values'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0.
    name minimum maximum config_value run_value
    ----------------------------------- ----------- ----------- ------------ -----------
    affinity mask 0 2147483647 0 0
    allow updates 0 1 1 1
    cost threshold for parallelism 0 32767 5 5
    cursor threshold -1 2147483647 -1 -1
    default language 0 9999 0 0
    default sortorder id 0 255 52 52
    extended memory size (MB) 0 2147483647 0 0
    fill factor (%) 0 100 0 0
    index create memory (KB) 704 1600000 0 0
    language in cache 3 100 3 3
    language neutral full-text 0 1 0 0
    lightweight pooling 0 1 0 0
    locks 5000 2147483647 0 0
    max async IO 1 255 32 32
    max degree of parallelism 0 32 0 0
    max server memory (MB) 4 2147483647 2147483647 2147483647
    max text repl size (B) 0 2147483647 65536 65536
    max worker threads 10 1024 255 255
    media retention 0 365 0 0
    min memory per query (KB) 512 2147483647 1024 1024
    min server memory (MB) 0 2147483647 0 0
    nested triggers 0 1 1 1
    network packet size (B) 512 65535 4096 4096
    open objects 0 2147483647 0 0
    priority boost 0 1 1 1
    query governor cost limit 0 2147483647 0 0
    query wait (s) -1 2147483647 -1 -1
    recovery interval (min) 0 32767 0 0
    remote access 0 1 1 1
    remote login timeout (s) 0 2147483647 5 5
    remote proc trans 0 1 0 0
    remote query timeout (s) 0 2147483647 0 0
    resource timeout (s) 5 2147483647 10 10
    scan for startup procs 0 1 0 0
    set working set size 0 1 0 0
    show advanced options 0 1 1 1
    spin counter 1 2147483647 10000 10000
    time slice (ms) 50 1000 100 100
    two digit year cutoff 1753 9999 2049 2049
    Unicode comparison style 0 2147483647 196609 196609
    Unicode locale id 0 2147483647 1033 1033
    user connections 0 32767 0 0
    user options 0 4095 0 0

    Table 'spt_values'. Scan count 43, logical reads 108, physical reads 0, read-ahead reads 0.
    Table 'sysconfigures'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 2.


  2. #2
    TH Guest

    More information...My server: NETFINITY 5500, 2 CPU, 512 MB RAM



    ------------
    TH at 7/10/01 12:30:58 AM


    In my database/MY SERVER (SQL7/Win2K), I run a simple query with a Table/10000 rows (without cluster index):
    SELECT * FROM TABLE
    it take over 30s. Why it's slow? How can I check for reason? How to configure my server to improve performance?
    Thanks in advance.
    TH
    ----------------------------------
    SP_CONFIGURE's RESULT in MY SERVER
    ----------------------------------

    Table 'spt_values'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0.
    name minimum maximum config_value run_value
    ----------------------------------- ----------- ----------- ------------ -----------
    affinity mask 0 2147483647 0 0
    allow updates 0 1 1 1
    cost threshold for parallelism 0 32767 5 5
    cursor threshold -1 2147483647 -1 -1
    default language 0 9999 0 0
    default sortorder id 0 255 52 52
    extended memory size (MB) 0 2147483647 0 0
    fill factor (%) 0 100 0 0
    index create memory (KB) 704 1600000 0 0
    language in cache 3 100 3 3
    language neutral full-text 0 1 0 0
    lightweight pooling 0 1 0 0
    locks 5000 2147483647 0 0
    max async IO 1 255 32 32
    max degree of parallelism 0 32 0 0
    max server memory (MB) 4 2147483647 2147483647 2147483647
    max text repl size (B) 0 2147483647 65536 65536
    max worker threads 10 1024 255 255
    media retention 0 365 0 0
    min memory per query (KB) 512 2147483647 1024 1024
    min server memory (MB) 0 2147483647 0 0
    nested triggers 0 1 1 1
    network packet size (B) 512 65535 4096 4096
    open objects 0 2147483647 0 0
    priority boost 0 1 1 1
    query governor cost limit 0 2147483647 0 0
    query wait (s) -1 2147483647 -1 -1
    recovery interval (min) 0 32767 0 0
    remote access 0 1 1 1
    remote login timeout (s) 0 2147483647 5 5
    remote proc trans 0 1 0 0
    remote query timeout (s) 0 2147483647 0 0
    resource timeout (s) 5 2147483647 10 10
    scan for startup procs 0 1 0 0
    set working set size 0 1 0 0
    show advanced options 0 1 1 1
    spin counter 1 2147483647 10000 10000
    time slice (ms) 50 1000 100 100
    two digit year cutoff 1753 9999 2049 2049
    Unicode comparison style 0 2147483647 196609 196609
    Unicode locale id 0 2147483647 1033 1033
    user connections 0 32767 0 0
    user options 0 4095 0 0

    Table 'spt_values'. Scan count 43, logical reads 108, physical reads 0, read-ahead reads 0.
    Table 'sysconfigures'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 2.


  3. #3
    sethu_sr Guest

    More information...My server: NETFINITY 5500, 2 CPU, 512 MB RAM (reply)

    Hi

    two things you can do to improve the performance (since
    your query do not have any where clause ,index will not help any
    way you can try this login as sa in query analyser and type the
    query and do a perform an index analyis (you can find this in the query menu) and see this can help you.

    next step :- since its select * from table (its will doing full table
    scan) if the table is highly fragmented then your full table scan will
    be slow (how to find out if the table is fragmented)

    run dbcc checktable 'yourtable name'

    you will get a report like this

    Table: 'srv' (309576141); index ID: 1, database ID: 7
    TABLE level scan performed.
    - Pages Scanned................................: 524203
    - Extents Scanned..............................: 74232
    - Extent Switches..............................: 391074
    - Avg. Pages per Extent........................: 7.1
    - Scan Density [Best Count:Actual Count].......: 16.76% [65526:391075](#######
    (this means fragmented should above 70% for good performance)
    - Logical Scan Fragmentation ..................: 75.26%
    - Extent Scan Fragmentation ...................: 9.76%
    - Avg. Bytes Free per Page.....................: 2531.0
    - Avg. Page Density (full).....................: 68.73%

    now how to increase the scan density (load all the data to new table and
    rename the newtable to oldname before doing this delete the oldtable.
    and then check your select * from table (it will be fast).

    Sethu



    ------------
    TH at 7/10/01 12:30:58 AM


    In my database/MY SERVER (SQL7/Win2K), I run a simple query with a Table/10000 rows (without cluster index):
    SELECT * FROM TABLE
    it take over 30s. Why it's slow? How can I check for reason? How to configure my server to improve performance?
    Thanks in advance.
    TH
    ----------------------------------
    SP_CONFIGURE's RESULT in MY SERVER
    ----------------------------------

    Table 'spt_values'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0.
    name minimum maximum config_value run_value
    ----------------------------------- ----------- ----------- ------------ -----------
    affinity mask 0 2147483647 0 0
    allow updates 0 1 1 1
    cost threshold for parallelism 0 32767 5 5
    cursor threshold -1 2147483647 -1 -1
    default language 0 9999 0 0
    default sortorder id 0 255 52 52
    extended memory size (MB) 0 2147483647 0 0
    fill factor (%) 0 100 0 0
    index create memory (KB) 704 1600000 0 0
    language in cache 3 100 3 3
    language neutral full-text 0 1 0 0
    lightweight pooling 0 1 0 0
    locks 5000 2147483647 0 0
    max async IO 1 255 32 32
    max degree of parallelism 0 32 0 0
    max server memory (MB) 4 2147483647 2147483647 2147483647
    max text repl size (B) 0 2147483647 65536 65536
    max worker threads 10 1024 255 255
    media retention 0 365 0 0
    min memory per query (KB) 512 2147483647 1024 1024
    min server memory (MB) 0 2147483647 0 0
    nested triggers 0 1 1 1
    network packet size (B) 512 65535 4096 4096
    open objects 0 2147483647 0 0
    priority boost 0 1 1 1
    query governor cost limit 0 2147483647 0 0
    query wait (s) -1 2147483647 -1 -1
    recovery interval (min) 0 32767 0 0
    remote access 0 1 1 1
    remote login timeout (s) 0 2147483647 5 5
    remote proc trans 0 1 0 0
    remote query timeout (s) 0 2147483647 0 0
    resource timeout (s) 5 2147483647 10 10
    scan for startup procs 0 1 0 0
    set working set size 0 1 0 0
    show advanced options 0 1 1 1
    spin counter 1 2147483647 10000 10000
    time slice (ms) 50 1000 100 100
    two digit year cutoff 1753 9999 2049 2049
    Unicode comparison style 0 2147483647 196609 196609
    Unicode locale id 0 2147483647 1033 1033
    user connections 0 32767 0 0
    user options 0 4095 0 0

    Table 'spt_values'. Scan count 43, logical reads 108, physical reads 0, read-ahead reads 0.
    Table 'sysconfigures'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 2.


  4. #4
    TH Guest

    Thank you very much! (empty inside)


  5. #5
    sethu sr Guest

    Slow Performance with a simple query in a small table? (reply)

    Hi

    i made a mistake to find table fragmentation you should use
    dbcc showcontig (917578307) (the object id of the table)
    this you can get by giving the table name in
    select * from sysobjects where name = 'tablename'.

    i wrongly type as dbcc checktable (this can used only to check
    if the table and index are ok,mainly for block corruption) sorry
    for the typo error

    Sethu


    ------------
    TH at 7/10/01 12:30:58 AM


    In my database/MY SERVER (SQL7/Win2K), I run a simple query with a Table/10000 rows (without cluster index):
    SELECT * FROM TABLE
    it take over 30s. Why it's slow? How can I check for reason? How to configure my server to improve performance?
    Thanks in advance.
    TH
    ----------------------------------
    SP_CONFIGURE's RESULT in MY SERVER
    ----------------------------------

    Table 'spt_values'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0.
    name minimum maximum config_value run_value
    ----------------------------------- ----------- ----------- ------------ -----------
    affinity mask 0 2147483647 0 0
    allow updates 0 1 1 1
    cost threshold for parallelism 0 32767 5 5
    cursor threshold -1 2147483647 -1 -1
    default language 0 9999 0 0
    default sortorder id 0 255 52 52
    extended memory size (MB) 0 2147483647 0 0
    fill factor (%) 0 100 0 0
    index create memory (KB) 704 1600000 0 0
    language in cache 3 100 3 3
    language neutral full-text 0 1 0 0
    lightweight pooling 0 1 0 0
    locks 5000 2147483647 0 0
    max async IO 1 255 32 32
    max degree of parallelism 0 32 0 0
    max server memory (MB) 4 2147483647 2147483647 2147483647
    max text repl size (B) 0 2147483647 65536 65536
    max worker threads 10 1024 255 255
    media retention 0 365 0 0
    min memory per query (KB) 512 2147483647 1024 1024
    min server memory (MB) 0 2147483647 0 0
    nested triggers 0 1 1 1
    network packet size (B) 512 65535 4096 4096
    open objects 0 2147483647 0 0
    priority boost 0 1 1 1
    query governor cost limit 0 2147483647 0 0
    query wait (s) -1 2147483647 -1 -1
    recovery interval (min) 0 32767 0 0
    remote access 0 1 1 1
    remote login timeout (s) 0 2147483647 5 5
    remote proc trans 0 1 0 0
    remote query timeout (s) 0 2147483647 0 0
    resource timeout (s) 5 2147483647 10 10
    scan for startup procs 0 1 0 0
    set working set size 0 1 0 0
    show advanced options 0 1 1 1
    spin counter 1 2147483647 10000 10000
    time slice (ms) 50 1000 100 100
    two digit year cutoff 1753 9999 2049 2049
    Unicode comparison style 0 2147483647 196609 196609
    Unicode locale id 0 2147483647 1033 1033
    user connections 0 32767 0 0
    user options 0 4095 0 0

    Table 'spt_values'. Scan count 43, logical reads 108, physical reads 0, read-ahead reads 0.
    Table 'sysconfigures'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 2.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •