count performance

Post Reply
gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

count performance

Post by gaurav.shetti »

I am running a query which is of the is form

select count(*) from doc_id where x=10 and b in (1,2,3,4 .... upto 50 entries) and query like abc

the count is taking too much time to return. it takes about 2000 seconds to return the count

If i remove the count and print docids it is done very fast. A binary index exists on doc_id.

I also tried
select count(doc_id) from doc_id where x=10 and b in (1,2,3,4 .... upto 50 entries) and query like abc

still the same old story.

Any suggestions to improve the performance.

There are about million documents that match the query and are satisfied by the above sql condition
gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

count performance

Post by gaurav.shetti »

xdocid group_profile xdocid A B 01 doc_id

This is from the SYSINDEX table.

And I am actaully putting the print statement within sql
<sql> print </sql>

and breaking the loop after 15 records. So you can say i am outputting a few records.
gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

count performance

Post by gaurav.shetti »

Can you explain the last line with an example
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

count performance

Post by mark »

gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

count performance

Post by gaurav.shetti »

In that case indexcount will be much larger than the actual count. Sometimes multiplied by 10 that huge, as we have many conditions in where clause
Post Reply