Re: queries with subquery constraints on partitioned tables not optimized? - Mailing list pgsql-performance

From Tom Lane
Subject Re: queries with subquery constraints on partitioned tables not optimized?
Date
Msg-id 5002.1265156054@sss.pgh.pa.us
Whole thread Raw
In response to queries with subquery constraints on partitioned tables not optimized?  ("Davor J." <DavorJ@live.com>)
Responses Re: queries with subquery constraints on partitioned tables not optimized?
Re: queries with subquery constraints on partitioned tables not optimized?
List pgsql-performance
"Davor J." <DavorJ@live.com> writes:
> Now, if one takes a subquery for "1", the optimizer evaluates it first
> (let's say to "1"), but then searches for it (sequentially) in every
> partition, which, for large partitions, can be very time-consuming and goes
> beyond the point of partitioning.

No, the optimizer doesn't "evaluate it first".  Subqueries aren't ever
assumed to reduce to constants.  (If you actually do have a constant
expression, why don't you just leave out the word SELECT?)

            regards, tom lane

pgsql-performance by date:

Previous
From: Matt White
Date:
Subject: Slow-ish Query Needs Some Love
Next
From: wyx6fox@sina.com
Date:
Subject: some problems when i use postgresql 8.4.2 in my projects .