[development] Guidelines for writing efficient SQL code

Jean-Michel Pouré jm at poure.com
Wed Aug 26 14:47:25 UTC 2009


Le mercredi 26 août 2009 à 07:25 -0700, David Metzler a écrit :
> A good decision on wether to use multi-column indexes will take into  
> account the cardinality of the data.  Sometimes a multi-column index  
> is simply the right answer, particularly if the values in the first  
> column of the  index do not limit the rows sufficiently.  Also  in  
> where exists clauses the rdbms will not even load the row if the  
> primary key is the composite index, but it will have to.  Indexes
> are  
> best thought of like caches,  You use the right caching mechanism
> for  
> the job, and you only do it when you can demonstrate performance  
> improvement.

Thanks David, I added this comment on the page, which is a perfect
summary. Kind regards, Jean-Michel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Ceci est une partie de message num?riquement sign?e
URL: <http://lists.drupal.org/pipermail/development/attachments/20090826/a11271ea/attachment.pgp>


More information about the development mailing list