Re: Re: [metabase-dev] numRows in the oracle driver
| From: | Manuel Lemos | Date: | Tue, 11 Mar 2003 14:21:58 +0000 |
| Subject: | Re: Re: [metabase-dev] numRows in the oracle driver | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-14200@lists.php.net to get a copy of this message | ||
Hello,
On 03/11/2003 10:25 AM, Lukas Smith wrote:
We are not introducing these issues in Oracle driver, we are just making Oracle driver provide the same features as MySQL driver.ofBut I am wondering why should we even allow people to fetch rows outSome people want to traverse the result set more than once. For small result sets that is not a great problem, so I do not see much point in disallowing that.But that creates memory issues for large result sets. As you point out these already exist for mysql. But why introduce these memory issues into the oracle driver?
If people want to traverse the result set more than once they can just do just that by using one of the bulk fetching methods. Then they have the data in an array with which they can do whatever they want.That is not the same thing. For database API like MySQL that already does their own buffering you are making the application spend more memory using bulk fetching.
I wanted to add this option before to Metabase, not because of Oracle but since MySQL got a non-buffered query function. The problem is that you can have more than one opened non-buffered query in MySQL, so I left it the way it was for a while to give it more time to think of a more realistic solution.queryOne possible thing would be to introduce a switch to always do theoverheadthat is done in PEAR DB's numRows() on every select and store that value. But I am not sure that this is really a good idea either.I do not like that solution because you are forcing a mandatoryto provide something that may not be needed. I prefer that you buffer the rows or not depeding on a hint passed by the programmer. When not buffering, NumberOfRows() would not be functional.Ah, you misunderstood me. I also want to make it possible for the programmer to set such a hint. Probably introducing a new option.
So then we would buffer the result set if users say they want to and in the default not buffer. I just got a mail from Lorenzo who is working onYes, but I would default to do buffering because that is the current behaviour of MySQL and several other database API that are popular among PHP users. Keep in mind that MySQL is most people's first database they work with in PHP.
an interbase driver. And interbase works much the same way as oracle there. So this decision undoubtly goes beyond "just" oracle.As I mentioned, this is the normal behaviour of high end databases including Oracle, Informix, Interbase, etc... as you may notice by peaking at the existing Metabase drivers. -- Regards, Manuel Lemos