Re: queries with subquery constraints on partitioned tables not optimized?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Davor J(dot)" <DavorJ(at)live(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: queries with subquery constraints on partitioned tables not optimized?
Date: 2010-02-03 00:14:14
Message-ID: 5002.1265156054@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Davor J." <DavorJ(at)live(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message wyx6fox 2010-02-03 02:28:30 some problems when i use postgresql 8.4.2 in my projects .
Previous Message Rob 2010-02-02 21:59:45 Re: System overload / context switching / oom, 8.3