Subject | Re: [firebird-php] ibase_num_rows instead of count(*) |
---|---|
Author | Lester Caine |
Post date | 2004-09-08T07:19:04Z |
Milan Babuskov wrote:
first record of a set, I think that is to be expected. Getting the first
record is fast, waiting for a count to be generated would be slow. Which
is why internal management of counts is the best way forward.
all records have to be visited to complete the operation.
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services
> Lester Caine wrote:Since the engine does not need to visit every record before giving the
>
>>>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 :(.
>>
>>THAT is a different problem. There has been some work on returning the
>>number of rows affected in PHP5 !
>
> It is very simple. Firebird does *not* provide any means to know how
> many record are available in the dataset. I even believe that the engine
> is designed that way, that in many cases it doesn't know either...
first record of a set, I think that is to be expected. Getting the first
record is fast, waiting for a count to be generated would be slow. Which
is why internal management of counts is the best way forward.
> OTOH, Firebird does provide the way to count number of rows *affected*The count of the number of rows affected has to be available, because
> by and UPDATE, DELETE and INSERT (with SELECT) statements, and that
> feature has been there since InterBase6 (or even earlier), just now it
> is going to be exposed in PHP5.
all records have to be visited to complete the operation.
> Hope this clears things a bit.My original comments were a bit rushed - sorry for that.
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services