Subject | Re: [firebird-php] ibase_num_rows instead of count(*) |
---|---|
Author | Almond |
Post date | 2004-09-07T17:41:29Z |
At 05:06 2004.09.07, Lester Caine wrote:
want to show the user the no. of record their query returns :(.
Some good news, the speed of query on the 20M table is very fast and I'm
still using 1.03. I'll switch to 1.5 next week for further improvement on
speed.
Thank you for your information.
Best regards,
Almond Wong
>Dariusz Zelichowski wrote:I do know that kind of trick, but it only return the total record count. I
>
> > I have an application in which I always need to know the
> > exact number of rows in some (not all) tables. I also found
> > count(*) to be on a slow side sometimes, although using
> > count(*) with a WHERE clause against indexed fields should
> > speed things up.
> >
> > Regardless, for each table where I need the row count I
> > created an extra table with one row and one field in it.
> > The field contains the number of records for one table.
> > Then I created 2 stored procedures INC_REC_COUNT and
> > DEC_REC_COUNT. Those are called via a trigger AFTER INSERT
> > or AFTER DELETE, respectively. Kinda a home brewed solution
> > but as of now this is the fastest solution I could think
> > of.
want to show the user the no. of record their query returns :(.
Some good news, the speed of query on the 20M table is very fast and I'm
still using 1.03. I'll switch to 1.5 next week for further improvement on
speed.
Thank you for your information.
Best regards,
Almond Wong