Page 1 of 1

Select with Order by Slow

Posted: Wed Jul 16, 2003 1:27 am
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!!

Select with Order by Slow

Posted: Wed Jul 16, 2003 10:50 am
by mark
Include docid in your text index.
create metamorph inverted index xmmtext on tbldoc(DTEXT,DOCID)