![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
on a 32 bit system, mysql client would die once it reaches the 32 bit hard limit. On 64 bit, it grows indefinitely. |
#2
| ||||
| ||||
|
|
One example was a big database (that was my personal) that somehow ended up with a corrupt table. REPAIR TABLE took literaly 13 hours and still was ongoing. I had to cancel it and move the database to a SSD, where repair took 30 minutes. |
|
Now here's what happened with the 90 gig database: I have a big table and made a query echo "select myfield from hugetable" | mysql -uuser -ppassword --batch -D mydatabase > field.txt A seemingly innocent query. |
|
It hang the Ubuntu Hardy server completely. I had to remotely hit a RESET button. |
|
So my first question is, is there some option to mysql that prevents it from growing like crazy. |
#3
| |||
| |||
|
|
One example was a big database (that was my personal) that somehow ended up with a corrupt table. REPAIR TABLE took literaly 13 hours and still was ongoing. I had to cancel it and move the database to a SSD, where repair took 30 minutes. |
|
Now here's what happened with the 90 gig database: I have a big table and made a query echo "select myfield from hugetable" | mysql -uuser -ppassword --batch -D mydatabase > field.txt A seemingly innocent query. |
|
It hang the Ubuntu Hardy server completely. I had to remotely hit a RESET button. |
#4
| |||
| |||
|
|
Op 27-6-2010 18:42, Ignoramus12901 schreef: on a 32 bit system, mysql client would die once it reaches the 32 bit hard limit. On 64 bit, it grows indefinitely. On a 64 bit machine it will probably crash when it reaches the 64 bit 'hard limit'.... I think this is OK, Why do you want to do a 'SELECT myfield from BIGTABLE' is it not enough to do a: 'SELECT myfield from BIGTABLE LIMIT 100;' ? |
|
What do you want to do with this 'millions' fo myfield values? I'm sure there's a better way than: 'SELECT myfield from BIGTABLE' just to do the same..... |
#5
| |||
| |||
|
|
On 2010-06-27, Luuk<luuk (AT) invalid (DOT) lan> wrote: Op 27-6-2010 18:42, Ignoramus12901 schreef: on a 32 bit system, mysql client would die once it reaches the 32 bit hard limit. On 64 bit, it grows indefinitely. On a 64 bit machine it will probably crash when it reaches the 64 bit 'hard limit'.... I think this is OK, Why do you want to do a 'SELECT myfield from BIGTABLE' is it not enough to do a: 'SELECT myfield from BIGTABLE LIMIT 100;' ? no What do you want to do with this 'millions' fo myfield values? I'm sure there's a better way than: 'SELECT myfield from BIGTABLE' just to do the same..... I want to do some stats on the values once I extract them. i |
#6
| |||
| |||
|
|
Norman Peelman <npeelman (AT) cfl (DOT) rr.com> wrote: num_rows * size_of_field = bytes_required 275 million rows, field is int. Not too much. |
#7
| |||
| |||
|
|
Now here's what happened with the 90 gig database: I have a big table and made a query echo "select myfield from hugetable" | mysql -uuser -ppassword --batch -D mydatabase > field.txt A seemingly innocent query. |
|
It hang the Ubuntu Hardy server completely. I had to remotely hit a RESET button. |
|
If yes, I will be happy. If not, I have to question whether this whole mysql was ever really designed to handle big databases. |
#8
| |||||
| |||||
|
|
On 2010-06-27, Jerry Stuckle <jstucklex (AT) attglobal (DOT) net> wrote: My question is why mysql client is buffering the result in memory? |
|
That's how all RDBMS's work by default. Gather the entire result set, then return it to the client on request. --batch does not affect buffering. |
|
What I am observing is that mysqld is working, moderately hard, and is not growing. At the same time, "mysql" (the client) is just growing in memory continuously, from the beginning of the query. |
|
If this is a correct conclusion, then I would like to question the client's behavior. |
|
Anyway, I will try tomorrow to write a perl/DBI based client to see if I can get around this by not using mysql as client. Maybe it will work and maybe it won't. |
#9
| |||
| |||
|
|
Ignoramus12901 wrote: Norman Peelman <npeelman (AT) cfl (DOT) rr.com> wrote: num_rows * size_of_field = bytes_required 275 million rows, field is int. Not too much. int? int what? int(11)? That would be over three billion bytes. Not too much. |
#10
| |||
| |||
|
|
Ignoramus12901 <ignoramus12901 (AT) NOSPAM (DOT) 12901.invalid> wrote: On 2010-06-27, Jerry Stuckle <jstucklex (AT) attglobal (DOT) net> wrote: My question is why mysql client is buffering the result in memory? Because that's the intended and documented, but configurable behavior. That's how all RDBMS's work by default. Gather the entire result set, then return it to the client on request. --batch does not affect buffering. Indeed. But --quick does. This has now been written twice. Maybe news article routing is asymmetric. I can see this "discussion" which does not hit the point at all, but silence on other posts that should be much more helpful... |
|
What I am observing is that mysqld is working, moderately hard, and is not growing. At the same time, "mysql" (the client) is just growing in memory continuously, from the beginning of the query. Congratulations! You observed the intended (and to say it again) *documented* behavior of result buffering in the client. If this is a correct conclusion, then I would like to question the client's behavior. I would rather question why you don't know such basics and why you don't just instruct the client to *not* buffer the result. Anyway, I will try tomorrow to write a perl/DBI based client to see if I can get around this by not using mysql as client. Maybe it will work and maybe it won't. If you instruct this client to not buffer the result then it will work. Just like the 'mysql' command line client. If you continue to ignore good advice, then it will not work. |
![]() |
| Thread Tools | |
| Display Modes | |
| |