Native D MySQL Driver

Steve Teale steve.teale at britseyeview.com
Fri Nov 4 09:25:50 PDT 2011


On Fri, 04 Nov 2011 15:04:39 +0000, Dejan Lekic wrote:
> 
> Yes it is. It is a common practice to get the whole thing rather than to
> take it in chunks. (Atomically so to speak) 1) The first thing that
> comes to mind is efficiency. 2) The second is - you remove the
> complexity (you will have to deal with various chunks).
> 3) The third reason, and the most important one, is the high possibility
> that your result set is going to change while you receive chunks. So, if
> you received it in chunks, it is possible that the overall data may be
> INCONSISTENT. So if you really wanted it to be done in chunks then you
> would have to make a snapshot of the result set on the database side,
> while behind the scenes those records keep being updated...

Dejan,

Don't get me wrong. I was not asking if it should be possible to get a 
complete result set, only if we needed to support sets with 2^^64 rows on 
a 32 bit system. Personally I think that is close to stupid - SQL is 
supposed to allow you to select the rows you want - not to make you do 
that on the client side.

I will also support the row by row approach, because there are users who 
prefer that. With the MySQL protocol, I don't think you need to worry 
about changes while stepping through rows. It's very basic - the server 
sends the whole result set over the wire in response to a query. Whether 
you read them all first or deal with them one at a time is academic. You 
still have to read them all before you can do anything else on that 
thread. So what you get is a snapshot either way.

Steve


More information about the Digitalmars-d mailing list