<br /><font face="sans-serif" size="2">On 04/17/2002 01:44:46 PM Michael Loftis wrote:<br /> > In many of the cases
whereit is a primary key it is also there to<br /> > ensure fast lookups when referenced as a foreign key. Or for
joins.<br/></font><br /><font face="sans-serif" size="2">Don't know if the optimizer takes this into consideration, but
aquery that uses a primary and/or unique key in the where-clause, should always choose to use the related indices
(assumingthe table size is above a certain threshold). Since a primary key/unique index always restricts the resultset
toa single row.....</font><br /><br /><font face="sans-serif" size="2">Somebody else mentioned that after creating an
index,he still had to run analyze in order to get the optimizer to choose to use the index. I thought that 'create
index'also updated pg_stats?</font><br /><br /><font face="sans-serif" size="2">Maarten</font><br /><font
face="sans-serif"size="2"><br /> ----<br /><br /> Maarten Boekhold, maarten.boekhold@reuters.com<br /><br /> Reuters
Consulting<br/> Dubai Media City<br /> Building 1, 5th Floor<br /> PO Box 1426<br /> Dubai, United Arab Emirates<br />
tel:+971(0)43918300 ext 249<br /> fax:+971(0)4 3918333<br /> mob:+971(0)505526539</font> <code><font size="3"><br /><br
/>------------------------------------------------------------- ---<br /> Visit our Internet site at
http://www.reuters.com<br/><br /> Any views expressed in this message are those of the individual<br /> sender, except
wherethe sender specifically states them to be<br /> the views of Reuters Ltd.<br /></font></code>