Re: Yet again on indices...
От | Thomas Swan |
---|---|
Тема | Re: Yet again on indices... |
Дата | |
Msg-id | 3C7D276C.304@ics.olemiss.edu обсуждение исходный текст |
Ответ на | Yet again on indices... (Jean-Paul ARGUDO <jean-paul.argudo@idealx.com>) |
Список | pgsql-hackers |
Tom Lane wrote:<br /><blockquote cite="mid22262.1014823120@sss.pgh.pa.us" type="cite"><pre wrap="">Jean-Paul ARGUDO <a class="moz-txt-link-rfc2396E"href="mailto:jean-paul.argudo@idealx.com"><jean-paul.argudo@idealx.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><prewrap=""><br /></pre><blockquote type="cite"><pre wrap="">Sort (cost=3006.13..3006.13 rows=25693width=46)<br /> -> Seq Scan on t12_20011231 (cost=0.00..1124.20 rows=25693 width=46)<br /></pre></blockquote><prewrap=""></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 /><prewrap=""></pre> and see what the actual results are. Then turn the seq_scans off and do the same thing.<br /><blockquotecite="mid22262.1014823120@sss.pgh.pa.us" type="cite"><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, veryprobably. 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 canget off all lists at once with the unregister command<br /> (send "unregister YourEmailAddressHere" to <a class="moz-txt-link-abbreviated"href="mailto:majordomo@postgresql.org">majordomo@postgresql.org</a>)<br /></pre></blockquote><br/><br />
В списке pgsql-hackers по дате отправления: