Home All Groups Group Topic Archive Search About

Select performance is one table, but not another



Author
25 Mar 2005 7:38 PM
JerryK
Hi,

I was noticed that at select (Select * from mytable) against one of my table
in QueryAnalyzer took forever to return results.  In the order of 12
minutes!  There are approximately 47,000 records in the table. I did a
select * against another table of the same size and it took a few seconds.
The table in question has one index on an autoincrementing ID field. A row
in the table consist of 20 fields and 500 bytes.

Any thought on why this would take so long.

Thanks,

Jerry

Author
25 Mar 2005 7:51 PM
JerryK
One more thing.  If you do a "Select * from mytable where somedata="value" "
the query returns in 2 seconds or so.  Even if somedata refers to a
non-indexed column.  The query plan for the qualified query shows 99% of the
time spent in the table scan.

Show quoteHide quote
"JerryK" <jerryk@nospam.com> wrote in message
news:%23K5%239IXMFHA.2132@TK2MSFTNGP14.phx.gbl...
> Hi,
>
> I was noticed that at select (Select * from mytable) against one of my
> table in QueryAnalyzer took forever to return results.  In the order of 12
> minutes!  There are approximately 47,000 records in the table. I did a
> select * against another table of the same size and it took a few seconds.
> The table in question has one index on an autoincrementing ID field. A row
> in the table consist of 20 fields and 500 bytes.
>
> Any thought on why this would take so long.
>
> Thanks,
>
> Jerry
>
>
>
>
Are all your drivers up to date? click for free checkup

Author
25 Mar 2005 9:00 PM
JerryK
Found it.

There is text column in the row and some of the text entries have 2 MB's
worth of data!


Show quoteHide quote
"JerryK" <jerryk@nospam.com> wrote in message
news:OmcFbQXMFHA.3660@TK2MSFTNGP12.phx.gbl...
> One more thing.  If you do a "Select * from mytable where somedata="value"
> " the query returns in 2 seconds or so.  Even if somedata refers to a
> non-indexed column.  The query plan for the qualified query shows 99% of
> the time spent in the table scan.
>
> "JerryK" <jerryk@nospam.com> wrote in message
> news:%23K5%239IXMFHA.2132@TK2MSFTNGP14.phx.gbl...
>> Hi,
>>
>> I was noticed that at select (Select * from mytable) against one of my
>> table in QueryAnalyzer took forever to return results.  In the order of
>> 12 minutes!  There are approximately 47,000 records in the table. I did a
>> select * against another table of the same size and it took a few
>> seconds. The table in question has one index on an autoincrementing ID
>> field. A row in the table consist of 20 fields and 500 bytes.
>>
>> Any thought on why this would take so long.
>>
>> Thanks,
>>
>> Jerry
>>
>>
>>
>>
>
>
Author
25 Mar 2005 8:17 PM
Andrew J. Kelly
Someone probably had had you blocked for most of that time.

--
Andrew J. Kelly  SQL MVP


Show quoteHide quote
"JerryK" <jerryk@nospam.com> wrote in message
news:%23K5%239IXMFHA.2132@TK2MSFTNGP14.phx.gbl...
> Hi,
>
> I was noticed that at select (Select * from mytable) against one of my
> table in QueryAnalyzer took forever to return results.  In the order of 12
> minutes!  There are approximately 47,000 records in the table. I did a
> select * against another table of the same size and it took a few seconds.
> The table in question has one index on an autoincrementing ID field. A row
> in the table consist of 20 fields and 500 bytes.
>
> Any thought on why this would take so long.
>
> Thanks,
>
> Jerry
>
>
>
>
Author
25 Mar 2005 8:39 PM
JerryK
No conflict,  I am the only on the database and on the machine

Strangely, SQLServer. exe starts to eat up all available memory on the
machine.  The memory allocation grows from 120 MBytes to 400 MBytes in
abvout 2 minutes.  DBCC Checkdatabase comes back clean, as does a DBCC
Checktable on the table.

jerry

Show quoteHide quote
"Andrew J. Kelly" <sqlmvpnooospam@shadhawk.com> wrote in message
news:%23ZkdpeXMFHA.4076@TK2MSFTNGP10.phx.gbl...
> Someone probably had had you blocked for most of that time.
>
> --
> Andrew J. Kelly  SQL MVP
>
>
> "JerryK" <jerryk@nospam.com> wrote in message
> news:%23K5%239IXMFHA.2132@TK2MSFTNGP14.phx.gbl...
>> Hi,
>>
>> I was noticed that at select (Select * from mytable) against one of my
>> table in QueryAnalyzer took forever to return results.  In the order of
>> 12 minutes!  There are approximately 47,000 records in the table. I did a
>> select * against another table of the same size and it took a few
>> seconds. The table in question has one index on an autoincrementing ID
>> field. A row in the table consist of 20 fields and 500 bytes.
>>
>> Any thought on why this would take so long.
>>
>> Thanks,
>>
>> Jerry
>>
>>
>>
>>
>
>
Author
25 Mar 2005 9:27 PM
Andrew J. Kelly
Why is that strange?  It is the exact behavior that you should expect.  SQL
Server will use up all memory available (minus a small amount) if it thinks
it can use it.  It does not release it once it grabs it unless the OS
specifically asks for it.  You are selecting all the rows (why who knows<g>)
from a table with large blobs in it.  That will certainly use up a lot of
memory.

--
Andrew J. Kelly  SQL MVP


Show quoteHide quote
"JerryK" <jerryk@nospam.com> wrote in message
news:eXhpErXMFHA.1308@TK2MSFTNGP15.phx.gbl...
> No conflict,  I am the only on the database and on the machine
>
> Strangely, SQLServer. exe starts to eat up all available memory on the
> machine.  The memory allocation grows from 120 MBytes to 400 MBytes in
> abvout 2 minutes.  DBCC Checkdatabase comes back clean, as does a DBCC
> Checktable on the table.
>
> jerry
>
> "Andrew J. Kelly" <sqlmvpnooospam@shadhawk.com> wrote in message
> news:%23ZkdpeXMFHA.4076@TK2MSFTNGP10.phx.gbl...
>> Someone probably had had you blocked for most of that time.
>>
>> --
>> Andrew J. Kelly  SQL MVP
>>
>>
>> "JerryK" <jerryk@nospam.com> wrote in message
>> news:%23K5%239IXMFHA.2132@TK2MSFTNGP14.phx.gbl...
>>> Hi,
>>>
>>> I was noticed that at select (Select * from mytable) against one of my
>>> table in QueryAnalyzer took forever to return results.  In the order of
>>> 12 minutes!  There are approximately 47,000 records in the table. I did
>>> a select * against another table of the same size and it took a few
>>> seconds. The table in question has one index on an autoincrementing ID
>>> field. A row in the table consist of 20 fields and 500 bytes.
>>>
>>> Any thought on why this would take so long.
>>>
>>> Thanks,
>>>
>>> Jerry
>>>
>>>
>>>
>>>
>>
>>
>
>

Bookmark and Share