db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Army <qoz...@gmail.com>
Subject Re: COUNT() optimisation
Date Fri, 08 Feb 2008 19:30:05 GMT
Daniel Noll wrote:
> COUNT() is constant performance if you count all the rows in a table, but 
> linear performance if you have a condition on which rows should be counted.

Can you can provide a simple example to demonstrate the behavior that 
you are seeing?  I tried playing around with some simple (nonsense) 
tables but I wasn't able to come up with anything that sounds like what 
you are describing.

Are you simply referring to something like:

   select count(*) from jobitems;


  select count(*) from jobitems where jobid = 4288;
  select count(*) from jobitems where jobid > 1000;

A working example might help to clarify what behavior you are seeing...

View raw message