Re: Index Scans become Seq Scans after VACUUM ANALYSE

From: Maarten(dot)Boekhold(at)reuters(dot)com
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Index Scans become Seq Scans after VACUUM ANALYSE
Date: 2002-04-18 07:17:34
Message-ID: T5a54bf4349c407b707760@reuters.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

<br><font size=2 face="sans-serif">On 04/17/2002 01:44:46 PM Michael Loftis wrote:<br>
&gt; In many of the cases where it is a primary key it is also there to<br>
&gt; ensure fast lookups when referenced as a foreign key. &nbsp;Or for joins.<br>
</font>
<br><font size=2 face="sans-serif">Don't know if the optimizer takes this into consideration, but a query that uses a primary and/or unique key in the where-clause, should always choose to use the related indices (assuming the table size is above a certain threshold). Since a primary key/unique index always restricts the resultset to a single row.....</font>
<br>
<br><font size=2 face="sans-serif">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 size=2 face="sans-serif">Maarten</font>
<br><font size=2 face="sans-serif"><br>
----<br>
<br>
Maarten Boekhold, maarten(dot)boekhold(at)reuters(dot)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)4 3918300 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 where the sender specifically states them to be<BR>
the views of Reuters Ltd.<BR>
</FONT></CODE>

Attachment Content-Type Size
unknown_filename text/html 1.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Adrian 'Dagurashibanipal' von Bidder 2002-04-18 07:37:46 Re: Index Scans become Seq Scans after VACUUM ANALYSE
Previous Message Luis Alberto Amigo Navarro 2002-04-18 07:16:34 Re: Index Scans become Seq Scans after VACUUM ANALYSE