Hi Becker,
This is how other RDBM's executes any count() query

SELECT STATEMENT

SORT                           AGGREGATE

TABLE ACCESS                   FULL            TABLENAME

They use the same plan when using the avg() query.
Note:No index is used for any count(columnname) query irrespective of if an index is 
available on that columnname or not.
(Which makes my use the index column workaround in SAPDB seem rather silly)


I ran an avg(columnname) queries in SAPDB and they run faster than count!!!.
(Did this only once so correct me if I'm wrong;-) )
But an AVG needs a COUNT. (Bcos as everyone knows AVG=TOTAL/COUNT)
So I assume you just need to see how avg gets the count and do the same thing for 
count queries.
Hope that's some use :-) 
Get back to me and let me know if u figure out something. 
Regards,
Ajit
P.S: I'm not sure what an aggregate sort on a non numeric column would do in other 
RDMS.But that's what the plan says.Any ideas?
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to