<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft Internet Assistant for PowerPoint 97">
<TITLE>The best laid plans</TITLE>
</HEAD>
<BODY >
<H1>The best laid plans</H1>
<P><UL>
<LI><H2>Query optimisation is hard
</H2>
<UL>
<LI>Intelligent high quality cost based query optimisation is really hard!
</UL></UL><UL>
<LI><H2>Know your optimiser
</H2>
<UL>
<LI>Oracle, Informix, Sybase, DB2, SQL Server etc. all slightly different.
</UL></UL><UL>
<LI><H2>Check what it's doing
</H2>
<UL>
<LI>Use tools to see the plans used for your queries - very helpful
</UL></UL><UL>
<LI><H2>Help it along
</H2>
<UL>
<LI>Most 'big name' databases have a mechanism to analyse and store the key distributions of indices to help the optimiser make good plans.
<UL>
<LI>Most important for tables with skewed (uneven) key distributions
<LI>Beware: keep it fresh, old key distributions might be worse than none
</UL><LI>Some also allow you to embed 'hints' into the SQL as comments
<UL>
<LI>Beware: take it easy, over hinting hinders dynamic optimisation
</UL></UL></UL><UL>
<H2>.</H2>
</UL></P>
<P></P>
<P>
<TABLE>
<TD HEIGHT=100 WIDTH=100> <A HREF="tsld010.htm">Previous slide</A> </TD>
<TD HEIGHT=100 WIDTH=100> <A HREF="tsld012.htm">Next slide</A> </TD>
<TD HEIGHT=100 WIDTH=150> <A HREF="tsld001.htm">Back to first slide</A> </TD>
<TD HEIGHT=100 WIDTH=150> <A HREF="sld011.htm">View graphic version</A> </TD>
</TABLE>
<BR>
</P>
</Body>
</HTML>