Hi Holger/Christian,

I thought of the cache issue, and therefore ran the command numerous times
from SQL Studio.  The first time is much longer for the Count(ID) and then
it drops to 4.5 seconds consistantly thereafter.  The time for count(*) is
not much different the first time, and then remains at 0.1 seconds.

How can this be?!!!

Cheers,

David




"Becker, Holger" <[EMAIL PROTECTED]> on 07/10/2003 03:42:28 AM

To:    "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
cc:
Subject:    RE: time difference between count(*) and count(id)


[EMAIL PROTECTED] wrote:

> Have seen postings before that count(*) is slower than counting on an
> index.
>
> However, I am seeing count(*) perform faster than count(id)!!
>
> Explain for Count(*) is:
>
> KIOSK  METRICS  METRICS_KIOSKID_EXECTIME_COPIES  INDEX SCAN
>                                  1206  *
> KIOSK                                                 RESULT
> IS COPIED   , COSTVALUE IS        1208
>
> and takes 110 milliseconds.
>
> Explain for count(id) is:
>
> KIOSK  METRICS  METRICS_KIOSKID_EXECTIME_COPIES  INDEX SCAN
>                                  1209  *
> KIOSK                                                 RESULT
> IS COPIED   , COSTVALUE IS        1211
>
> and takes approx 4.5 seconds!!!
>
> Can someone please explain? (no pun intended!)

Because of the same strategy in both cases I assume you
see caching effects.
To check this out you have to measure the execution time
of both statement right after the restart of the db.

Kind regards,
Holger
 SAP Labs Berlin






-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to