<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title></title>
</head>
<body>
Tom Lane wrote:<br>
<blockquote type="cite" cite="mid22262(dot)1014823120(at)sss(dot)pgh(dot)pa(dot)us">
  <pre wrap="">Jean-Paul ARGUDO <a class="moz-txt-link-rfc2396E" href="mailto:jean-paul(dot)argudo(at)idealx(dot)com"><jean-paul(dot)argudo(at)idealx(dot)com></a> writes:<br></pre>
  <blockquote type="cite">
    <pre wrap="">EXPLAIN SELECT t12_bskid, t12_pnb, t12_lne, t12_tck<br>FROM T12_20011231<br>WHERE t12_bskid >= 1   <br>ORDER BY t12_bskid, t12_pnb, t12_tck, t12_lne;<br></pre>
  </blockquote>
  <pre wrap=""><!----><br></pre>
  <blockquote type="cite">
    <pre wrap="">Sort  (cost=3006.13..3006.13 rows=25693 width=46)<br>  ->  Seq Scan on t12_20011231  (cost=0.00..1124.20 rows=25693 width=46)<br></pre>
  </blockquote>
  <pre wrap=""><!----></pre>
</blockquote>
Try the following:<br>
<br>
EXPLAIN ANALYZE SELECT t12_bskid, t12_pnb, t12_lne, t12_tck FROM T12_20011231
WHERE t12_bskid >= 1    ORDER BY t12_bskid, t12_pnb, t12_tck, t12_lne;<br>
 
<pre wrap=""><!----></pre>
and see what the actual results are.  Then turn the seq_scans off and do
the same thing.<br>
<blockquote type="cite" cite="mid22262(dot)1014823120(at)sss(dot)pgh(dot)pa(dot)us">
  <pre wrap=""><br></pre>
  <blockquote type="cite">
    <pre wrap="">=> Uh? Seq scan cheaper than index???  <br></pre>
  </blockquote>
  <pre wrap=""><!----><br>For that kind of query, very probably.  How much of the table is<br>actually selected by "WHERE t12_bskid >= 1"?<br><br>			regards, tom lane<br><br>---------------------------(end of broadcast)---------------------------<br>TIP 2: you can get off all lists at once with the unregister command<br>    (send "unregister YourEmailAddressHere" to <a class="moz-txt-link-abbreviated" href="mailto:majordomo(at)postgresql(dot)org">majordomo(at)postgresql(dot)org</a>)<br></pre>
</blockquote>
<br>
<br>
</body>
</html>