Subject Re: [firebird-php] ibase_num_rows instead of count(*)
Author Almond
At 05:06 2004.09.07, Lester Caine wrote:
>Dariusz Zelichowski wrote:
> > 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.

I do know that kind of trick, but it only return the total record count. I
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

Thank you for your information.

Best regards,

Almond Wong