Re: Index Scans become Seq Scans after VACUUM ANALYSE

From: Maarten(dot)Boekhold(at)reuters(dot)com
To: tycho(at)fruru(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Index Scans become Seq Scans after VACUUM ANALYSE
Date: 2002-04-19 09:27:05
Message-ID: T5a5a2f68b6c407b706700@reuters.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

<br><font size=2 face="sans-serif">On 04/18/2002 12:41:15 PM tycho wrote:<br>
&gt; &gt; Don't know if the optimizer takes this into consideration, but a query that <br>
&gt; uses a primary and/or unique key in the where-clause, should always choose to <br>
&gt; use<br>
&gt; &gt; the related indices (assuming the table size is above a certain threshold). <br>
&gt; Since a primary key/unique index always restricts the resultset to a single <br>
&gt; row.....<br>
&gt; <br>
&gt; I don't think so.<br>
&gt; <br>
&gt; eg. table with primary key &quot;pk&quot;, taking values from 1 to 1000000 (so<br>
&gt; 1000000 records)<br>
&gt; <br>
&gt; select * from table where pk &gt; 5<br>
&gt; <br>
&gt; should probably not use the index ...<br>
</font>
<br><font size=2 face="sans-serif">Oops, you're right of course. Rephrase the above as 'a query that uses a primary key to uniquely qualify a single row' (which pretty much restricts it to the = operator with a constant). Still, this is probably a fairly common case.....</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.7 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Mario Weilguni 2002-04-19 10:11:48 Re: Large object security
Previous Message Damon Cokenias 2002-04-19 09:03:38 Large object security