Re: 8.4, One-Time Filter and subquery ( ... FROM function() union all ... )

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sergey Burladyan <eshkinkot(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 8.4, One-Time Filter and subquery ( ... FROM function() union all ... )
Date: 2009-07-06 18:30:22
Message-ID: 19075.1246905022@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sergey Burladyan <eshkinkot(at)gmail(dot)com> writes:
> PostgreSQL 8.4.0 on i486-pc-linux-gnu, compiled by GCC gcc-4.3.real (Debian 4.3.3-13) 4.3.3, 32-bit

> EXPLAIN ANALYZE select * from (select 1 as i, r from foo() r union all select 2, r from foo() r) as x where i = 3;
> QUERY PLAN
> -----------------------------------------------------------------------------------------------------------------------
> Result (cost=0.00..0.53 rows=2 width=36) (actual time=10007.352..10007.352 rows=0 loops=1)
> -> Append (cost=0.00..0.53 rows=2 width=36) (actual time=10007.351..10007.351 rows=0 loops=1)
> -> Function Scan on foo r (cost=0.00..0.26 rows=1 width=36) (actual time=5003.342..5003.342 rows=0 loops=1)
> Filter: (1 = 3)
> -> Function Scan on foo r (cost=0.00..0.26 rows=1 width=36) (actual time=5004.004..5004.004 rows=0 loops=1)
> Filter: (2 = 3)
> Total runtime: 10007.464 ms

As of CVS HEAD you get

QUERY PLAN
------------------------------------------------------------------------------------
Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.011..0.011 rows=0 loops=1)
One-Time Filter: false
Total runtime: 0.179 ms
(3 rows)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2009-07-06 18:37:52 Re: information_schema.columns changes needed for OLEDB
Previous Message Bruce Momjian 2009-07-06 17:51:36 Re: TODO items: Alter view add column