Re: Which strategy is better to traverse a big table?
Thanks to khan and James. Starting from your comments, I investigate
mysql C API and found that mysql_store_result (that I used in my codes)
does not deliver results piecemeal, instead it delivers the whole results
at once.
Another function mysql_use_result(), however, can handle big results
more efficiently. It initiates a row-by-row result set retrieval. In my
case, I'll select all qualified rows and use this function to process
the result row by row.
NOTE: mysql_use_result() may have deadlock problem, as mentioned in the manual:
"you shouldn't use mysql_use_result() if you are doing a lot of processing for
each row on the client side, or if the output is sent to a screen on which the
user may type a ^S (stop scroll). This ties up the server and prevent other
threads from updating any tables from which the data is being fetched. "
Thanks again for your help. I found this forum is very active and helpful!
Subject
Views
Written By
Posted
4510
February 23, 2009 01:58AM
2019
February 23, 2009 07:04AM
1848
February 24, 2009 11:29AM
Re: Which strategy is better to traverse a big table?
1910
February 25, 2009 02:25PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.