Can I force MySQL to output results before query is completed?

Posted by Gordon Royle on Stack Overflow See other posts from Stack Overflow or by Gordon Royle
Published on 2011-03-15T07:46:37Z Indexed on 2011/03/15 8:09 UTC
Read the original article Hit count: 176

Filed under:
|

I have a large MySQL table (about 750 million rows) and I just want to extract a couple of columns.

SELECT id, delid FROM tbl_name;

No joins or selection criteria or anything. There is an index on both fields (separately).

In principle, it could just start reading the table and spitting out the values immediately, but in practice the whole system just chews up memory and basically grinds to a halt.

It seems like the entire query is being executed and the output stored somewhere before ANY output is produced...

I've searched on unbuffering, turning off caches etc, but just cannot find the answer.

(mysqldump is almost what I want except it dumps the whole table - but at least it just starts producing output immediately)

© Stack Overflow or respective owner

Related posts about mysql

Related posts about select