Charlie Schaubmair wrote:
Hello Michael,

thx, I know normalisation.

BUT normalisation isn't always the best (fastest) way to store, or select
the datas, this is why I don't use it most time.
Often I'm testing my projects with normalisation and without and my last
very big problem with big select statements is very fast without
normalisation and with normalisation it was very slow.

br
Charlie

The point of properly normalized and indexed tables is that they almost
always produce more efficient queries. There are exceptions, of course, but
they are just that, exceptions, and I assure you, this is not one of those
times. Finding rows with a particular attribute was made difficult by the
lack of normalization. More to the point, there is no chance that

  SELECT *
  FROM MyTable_attributes
  WHERE FIND_IN_SET(1, someFieldInMyTable);

with the denormalized design is close to as fast as

  SELECT m.*
  FROM MyTable m
  JOIN MyTable_attributes ma ON m.MyTable_id = ma.MyTable_id
  WHERE ma.attribute = 1;

with the normalized design, as long as the proper indexes are present.  The
former is a guaranteed full-table scan, while the latter is a simple index look 
up.

Michael


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to