Re: Problem with inherited tables vs query planning - Mailing list pgsql-general

From Tom Lane
Subject Re: Problem with inherited tables vs query planning
Date
Msg-id 17674.1179456557@sss.pgh.pa.us
Whole thread Raw
In response to Problem with inherited tables vs query planning  ("Dave Golombek" <daveg@blackducksoftware.com>)
Responses Re: Problem with inherited tables vs query planning
List pgsql-general
"Dave Golombek" <daveg@blackducksoftware.com> writes:
> Is there a way I can reformulate the query to help the planner use the
> indices?

Use 8.2.  Also put an index on the base table, not only the children ---
the forced seqscan on the base weighs down the cost estimate for the
plan you would like to have.  (With sufficiently large child tables,
that might not matter, but it sure does for this toy example.)

            regards, tom lane

pgsql-general by date:

Previous
From: "Dave Golombek"
Date:
Subject: Problem with inherited tables vs query planning
Next
From: "Robert James"
Date:
Subject: Postgres / Jaro Winkler fuzzy string matching