"Fabricio Mota" <[EMAIL PROTECTED]> wrote on 11/02/2005 10:23:46 AM:

> Hi all,
> 
> In the past, I worked as a Oracle user. I've noted that in oracle (or 
maybe
> in that configuration), when we request a great amount of data, such 
like:
> 
> select * from million_records_table
> 
> It does not delivers the entire table at the first moment. It delivers a
> little amount of data - such like a single page containing about 100
> records - and awaits the cursor request the Record No 101 for fetch the 
next
> set of data.
> 
> In MySQL - at least, with the default configuration I have used - it 
does
> not happens. It delivers all the million of records existent in the 
table,
> inconditionally. I know that there is the clause LIMIT <N>, to limit the
> first N records existing in the query, but is there a way to warrant a
> "delivery by demand", such Oracle does, without to have to alter the
> application's SQL code?
> 
> Thank you

I know that in the C-API (and others) there are two commands to retrieve 
records from the server. One is mysql_store_result() which will bring all 
of your results into your machine in a single pull. 

The second is mysql_use_result(). That command sets up a transfer process 
of pulling the rows from the server one at a time. If you need 100 rows of 
data, you issue 100 mysql_fetch_row() commands. You are responsible for 
storing the records for later re-use.

Is that the flexibility you are looking for?

http://dev.mysql.com/doc/refman/5.0/en/mysql-use-result.html

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

Reply via email to