Live data from Hacker News

20 tips for MySQL db architects

scribd.com

21–27 of 27 posts

Re: 20 tips for MySQL db architects

#21
post #18

The meta-point for me is that SQL is just broken, as are its many implementations. We'd never tolerate a scripting language that made you learn all the implementation details before you were effective with it. And yet we tolerate this from database engines and the languages we use to interact with them. The opposite end of the spectrum is modern compilers. C/C++ compilers are generally so good that most attempts at n…

I just wish that that knowledge was embedded in the products themselves

Err, it is. Oracle, Sybase, MS SQL, Informix, all the major database products have sophisticated query optimizers. You use SQL to describe the result set you want, and it figures out the best way to get it.

Sadly the Web 2.0 world is full of people who actually believe MySQL is as good as databases get, having never used anything else. It's probably a good 10-15 years behind the state-of-the-art, at least (and Oracle et al are behind in niche areas).

Re: 20 tips for MySQL db architects

#22
post #21
post #18

The meta-point for me is that SQL is just broken, as are its many implementations. We'd never tolerate a scripting language that made you learn all the implementation details before you were effective with it. And yet we tolerate this from database engines and the languages we use to interact with them. The opposite end of the spectrum is modern compilers. C/C++ compilers are generally so good that most attempts at n…

I just wish that that knowledge was embedded in the products themselves Err, it is. Oracle, Sybase, MS SQL, Informix, all the major database products have sophisticated query optimizers. You use SQL to describe the result set you want, and it figures out the best way to get it. Sadly the Web 2.0 world is full of people who actually believe MySQL is as good as databases get, having never used anything else. It's proba…

Agreed. A single look at a performance chart for MySQL under simultaneous transaction load shows it crumbling under. Furthermore, it has had substandard ACID support and substandard ANSI SQL support for generations and these problems are just starting to get fixed. Using MySQL as an indicator for the rest of the industry is deeply misguided.

Re: 20 tips for MySQL db architects

#23
post #21
post #18

The meta-point for me is that SQL is just broken, as are its many implementations. We'd never tolerate a scripting language that made you learn all the implementation details before you were effective with it. And yet we tolerate this from database engines and the languages we use to interact with them. The opposite end of the spectrum is modern compilers. C/C++ compilers are generally so good that most attempts at n…

I just wish that that knowledge was embedded in the products themselves Err, it is. Oracle, Sybase, MS SQL, Informix, all the major database products have sophisticated query optimizers. You use SQL to describe the result set you want, and it figures out the best way to get it. Sadly the Web 2.0 world is full of people who actually believe MySQL is as good as databases get, having never used anything else. It's proba…

I hear the points about query optimizers that you and the other repliers have made. (And they are valid points, all. I was just misinformed about MySQL.) I was more addressing the points made about database design decisions w/respect to data type choice and their effect on storage requirements and speed. I was wondering, specifically, if it is technically feasible to allow designers to specify 'text' or 'string' at design time, enter in some typical data, and have the engine choose the optimum type subject to its implementation constraints.

That said, it seems like I need to educate myself on the various products, though any prototypes I build will still use MySQL just because of the price point. :o)

Re: 20 tips for MySQL db architects

#24
post #23
post #21

Earlier quoted context omitted.

I just wish that that knowledge was embedded in the products themselves Err, it is. Oracle, Sybase, MS SQL, Informix, all the major database products have sophisticated query optimizers. You use SQL to describe the result set you want, and it figures out the best way to get it. Sadly the Web 2.0 world is full of people who actually believe MySQL is as good as databases get, having never used anything else. It's proba…

I hear the points about query optimizers that you and the other repliers have made. (And they are valid points, all. I was just misinformed about MySQL.) I was more addressing the points made about database design decisions w/respect to data type choice and their effect on storage requirements and speed. I was wondering, specifically, if it is technically feasible to allow designers to specify 'text' or 'string' at d…

Check out PostgreSQL, Firebird and SAP/DB. I can't think of a single technical or commercial reason to use MySQL.

Re: 20 tips for MySQL db architects

#25

Earlier quoted context omitted.

> So there is no reason to artificially use a smaller value. That's not true either. As the document explains, MySQL's internal buffering uses fixed sized columns matching the length limit of the VARCHAR column. So a VARCHAR(255) will cause 255 bytes of memory to be allocated versus only 20 for VARCHAR(20). Of course, it depends on what range of sizes your data fit as to what you do :)

This is also multiplied by the character encoding, so when you have a table with 10 columns at VARCHAR(255) because your too lazy to define them, and they are all UTF8, so that's 255*3 for each column for each row when used in a MySQL Internal buffer (not, these buffers may or may not be used depending on the type of query). When you have 100s to 1000s of queries per second, knowing and using your memory wisely is ve…

Kinda the point of UTF encoding is it's variable-width; if you only need ASCII then that's all you'll store. The MySQL people seem to have chosen to use the worst possible case every time regardless; this is not a "feature".

Re: 20 tips for MySQL db architects

#26
post #24
post #23

Earlier quoted context omitted.

I hear the points about query optimizers that you and the other repliers have made. (And they are valid points, all. I was just misinformed about MySQL.) I was more addressing the points made about database design decisions w/respect to data type choice and their effect on storage requirements and speed. I was wondering, specifically, if it is technically feasible to allow designers to specify 'text' or 'string' at d…

Check out PostgreSQL, Firebird and SAP/DB. I can't think of a single technical or commercial reason to use MySQL.

Correction. There is one reason. Its a lot easier to find MySQL devs. than postgres, firebird, or SAP/DB devs even though the latter are a far superior product technically.

Re: 20 tips for MySQL db architects

#27
post #23
post #21

Earlier quoted context omitted.

I just wish that that knowledge was embedded in the products themselves Err, it is. Oracle, Sybase, MS SQL, Informix, all the major database products have sophisticated query optimizers. You use SQL to describe the result set you want, and it figures out the best way to get it. Sadly the Web 2.0 world is full of people who actually believe MySQL is as good as databases get, having never used anything else. It's proba…

I hear the points about query optimizers that you and the other repliers have made. (And they are valid points, all. I was just misinformed about MySQL.) I was more addressing the points made about database design decisions w/respect to data type choice and their effect on storage requirements and speed. I was wondering, specifically, if it is technically feasible to allow designers to specify 'text' or 'string' at d…

To give an example on varchars. Postgres never uses more space for varchars than strictly necessary. In fact, it is common to use text columns which are varchars extended to 2 gigabytes. Furthermore, postgres is capable of automatically compressing and decompressing data on the fly, no interaction required.

It also has specialized data types for pretty much any task you can imagine and a very robust extension system in case you need to roll your own types.

Post reply on HN