Subject | Re: [firebird-support] Re: If Not SELECT COUNT(*), Then What? |
---|---|
Author | Woody |
Post date | 2008-12-18T18:18:47Z |
From: "danyschaer" <danyschaer@...>
for a certain type of material and a particular customer? I do reports all
the time where only the totals are shown, not the details.
You can't keep statistics in the database for all conceivable combinations
of filtering that a client might want to see on a report or anywhere else.
The only way is to do a "select count" OR just a select and count the
records yourself.
IMHO, there is no way possible to store count information unless you know
ahead of time exactly what you want to count, therefore a "select count" is
a necessary query for me.
Woody (TMW)
> Hi Dimitry;How else can you get a total # of orders processed within a given date range
>
> Well, I can imagine a few situations right now. But the most important
> argument for making "count()" to work faster, is: because in the most
> popular databases engines it works faster; and, because "count()" works
> faster in other databases engines, programers are using it, even when
> it is crazy to do that.
for a certain type of material and a particular customer? I do reports all
the time where only the totals are shown, not the details.
You can't keep statistics in the database for all conceivable combinations
of filtering that a client might want to see on a report or anywhere else.
The only way is to do a "select count" OR just a select and count the
records yourself.
IMHO, there is no way possible to store count information unless you know
ahead of time exactly what you want to count, therefore a "select count" is
a necessary query for me.
Woody (TMW)