Re: bad plan with custom data types - Mailing list pgsql-hackers

From Tom Lane
Subject Re: bad plan with custom data types
Date
Msg-id 29427.1164209278@sss.pgh.pa.us
Whole thread Raw
In response to bad plan with custom data types  (Greg Mitchell <gmitchell@atdesk.com>)
Responses Re: bad plan with custom data types  (Greg Mitchell <gmitchell@atdesk.com>)
List pgsql-hackers
Greg Mitchell <gmitchell@atdesk.com> writes:
> I don't understand why it re-sorts the data even though the indexes are in
> the same order?

What are the available indexes exactly?  It looks to me from the names
that the indexes probably *don't* match the sort order the merge is
using.  What I'm wondering is whether the planner should be expected to
find a merge plan that adapts to the available indexes.  In the light
of morning I doubt this has anything to do with custom data types at
all, but with the fact that the planner doesn't exhaustively search
through every possible combination of mergejoin conditions.

If you turn off enable_sort as well, does it find a sort-free merge
plan?
        regards, tom lane


pgsql-hackers by date:

Previous
From: David Fuhry
Date:
Subject: Re: build a SDB cache for Spatial Database based on postgis
Next
From: "zhang Jackie"
Date:
Subject: how to profile PostGreSQL