Search Postgresql Archives

Re: Unable to use index?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Edmund Dengler <edmundd@eSentire.com> writes:
> Hmm, interesting as I have that table clustered starting with the
> rep_component, so 'ps_probe' will definitely appear later in a sequential
> scan. So why does the <order by> force the use of the index?

It does not "force" anything, it simply alters the cost estimates.  The
seqscan-based plan requires an extra sort step to meet the ORDER BY,
while the indexscan plan does not.  In this particular scenario the
indexscan plan is estimated to beat seqscan+sort, but in other cases the
opposite decision might be made.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux