![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
Beauregard T. Shagnasty wrote: 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. No, int(11) is still only 4 or 8 bytes - the 11 only relates to the display length, not internal storage. |
#12
| |||
| |||
|
|
Jerry Stuckle <jstucklex (AT) attglobal (DOT) net> wrote: Beauregard T. Shagnasty wrote: 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. No, int(11) is still only 4 or 8 bytes - the 11 only relates to the display length, not internal storage. Right. And wrong. Internal storage format does not matter here. Results for nonprepared statements are sent and stored in character representation[1] That means a row (INT, DOUBLE, CHAR(5)) with values (123456, 3.141592654, "fubar") will use 6+11+5 bytes just to represent the data. Plus some overhead (basically a length coded number for each field). 275 Mio rows will be around 275Mio * 10 bytes netto, probably more like 275 Mio * 20 bytes brutto. That's a lot. Things are different for prepared statements. Then results are sent using a binary representation. [1] the details are here: http://forge.mysql.com/wiki/MySQL_In..._Data_Pac ket XL |
#13
| ||||
| ||||
|
|
Axel Schwenke wrote: .... Results for nonprepared statements are sent and stored in character representation .... |
|
You're |
|
actually transferring numeric data in character format? That would be extremely stupid. |
|
So I guess then you have to convert it back into non-character values to get the data in a C program. |
#14
| ||||
| ||||
|
|
Jerry Stuckle <jstucklex (AT) attglobal (DOT) net> wrote: Axel Schwenke wrote: ... Results for nonprepared statements are sent and stored in character representation ... You're Well, not me. But that's how Monty designed it ages ago. How can you be a "MySQL Expert" without knowing that? |
|
actually transferring numeric data in character format? That would be extremely stupid. It avoids some problems with i.e. floating point rounding. Also most data in DBMS can be considered characters anyway. |
|
But yes, this design decision is questionable. |
|
So I guess then you have to convert it back into non-character values to get the data in a C program. Either that or use the prepared statement API. Not that it solves all problems like byte order or floating point format. But at least you avoid the atoi(itoa(...)) madness. XL |
#15
| |||
| |||
|
|
Axel Schwenke wrote: actually transferring numeric data in character format? That would be extremely stupid. It avoids some problems with i.e. floating point rounding. Also most data in DBMS can be considered characters anyway. Not at all. In fact, in most major databases, the data is anything BUT characters. Numeric and bit data is much more common. But then MySQL isn't being used for major databases, is it? |
|
Note that I'm not talking about "big" databases. I'm talking about databases where data integrity and database performance are critical. All of those use Oracle, DB/2 or SQL Server. |
|
But yes, this design decision is questionable. Just another reason why MySQL can't compete with real databases. |
#16
| |||
| |||
|
|
You're actually transferring numeric data in character format? That would be extremely stupid. |
|
So I guess then you have to convert it back into non-character values to get the data in a C program. |
#17
| |||
| |||
|
|
(Don't get me started about phone numbers stored as type DOUBLE...) |
#18
| |||
| |||
|
|
"Peter H. Coffin" <hellsop (AT) ninehells (DOT) com> wrote: (Don't get me started about phone numbers stored as type DOUBLE...) -v PLEASE!!!1! SCNR, XL |
#19
| |||
| |||
|
|
MySQL not designed for LARGE databases? |
![]() |
| Thread Tools | |
| Display Modes | |
| |