ajit_cus wrote:

>   This is my way of optimizing my count(*) queries under SAPDB:
> 1>Select Count(*) from testtable
> Takes  1:14 secs returns 240830
> This is the output of explain:
> TABLE SCAN                                               
> RESULT IS COPIED  
> 
> Instead I use this:
> 2>Select Count(aNotNullColumnWithanIndex) from testtable
> Takes  12 seconds returns 240830
> This is the output of explain:
> SINGLE INDEX COLUMN USED (INDEX SCAN)
> RESULT IS COPIED             
> As you can see 2 is lot faster than 1 and should always give 
> the same result. I only wish that SAPDB was smart enough to 
> do that internally.
> 

With version 7.4 your wish became true and if I find some time 
I'll integrate this feature into version 7.3.

> However this can't be the way other DB's function as they are 
> still a lot faster than the index scan method. Under oracle 
> any count query (irrespective of index's on columns) seems to 
> always run in under 1 sec (trying this on an ORACLE table 
> with 150000 records-->note that it's identical in schema to 
> my SAPDB test table.) 

I suppose ORACLE updates a row counter for every insert and delete.
But I'm not sure because this could let into concurrency problems.
I'm appreciate for every hint on this topic. 

> I wonder if there are any SAPDB parameters that affect 
> performance of count queries?

no

Kind regards,
Holger
SAP Labs Berlin
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to