[TYPO3-dev] DB query iterator; worth a try?

Ries van Twisk typo3 at rvt.dds.nl
Thu Apr 22 18:46:05 CEST 2010


On Apr 22, 2010, at 11:31 AM, Jigal van Hemert wrote:

> Hi,
>
> Xavier Perseguers wrote:
>> I did not make any research but basically I like the idea. However,  
>> I'd like to make sure it'd work with DBAL and other DBMS too  
>> (Oracle, MSSQL and PostgreSQL). But I guess this should be OK but  
>> would be cool to be investigated a little bit before trying to do  
>> it for real.
>
> Well, since you're the expert on DBAL:
> Can you tell if the other DBMS-es support somehow a method to tell  
> if there is a new record available? If that is the case, an iterator  
> can be  used.
>
> BTW, it's not about the coolness factor, I just like the simplicity  
> of a foreach for example on an iterator object.

I believe for some databases that don't support cursors the whole  
dataset will be loaded into PHP anyways.

In fact, if my memory serves right is that for the current  
implementations in PHP for normal queries (not cursor based)
the whole dataset will be read into memory using one call to the RDBM  
and you can iterate over them
because the DS is already there. There is not real 'need' from the  
RDBM to support this.
Using cursors is a whole different story.

Ries







More information about the TYPO3-dev mailing list