Select with Order by Slow

Post Reply
skalyanaraman
Posts: 109
Joined: Tue May 29, 2001 9:13 pm

Select with Order by Slow

Post by skalyanaraman »

Hi,
We have a database that is 4.5 gB(out of which 4Gb is a blob field/file lets call it DTEXT). This table is well indexed.
if I do,
tsql -l10 "select DOCID from tbldoc where DTEXT like 'test'"
I get the results in less than 2 secs.

But if I do,
tsql -l10 "select DOCID from tbldoc where DTEXT like 'test' order by DOCID"
This finishes in about 25-30 secs.

We have a unique index on DOCID.
Is there anyway we can speed this search up?

Any help is greatly appreciated.

Thanks!!
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Select with Order by Slow

Post by mark »

Include docid in your text index.
create metamorph inverted index xmmtext on tbldoc(DTEXT,DOCID)
Post Reply