7

text/plain

Filename: 7
Type: text/plain
Part: 0
Message: Re: [HACKERS] having and union in v7beta
psql7=# select count(*) from comuni;
 count
-------
  8342
(1 row)

psql7=> EXPLAIN select distretto from comuni union select codice_fiscale from comuni;
NOTICE:  QUERY PLAN:

Unique  (cost=1767.19..1808.90 rows=1668 width=12)
  ->  Sort  (cost=1767.19..1767.19 rows=16684 width=12)
        ->  Append  (cost=0.00..464.84 rows=16684 width=12)
                ->  Seq Scan on comuni  (cost=0.00..232.42 rows=8342 width=12)
                ->  Seq Scan on comuni  (cost=0.00..232.42 rows=8342 width=12)

EXPLAIN


psql65=> select count(*) from comuni;
 count
-------
  8342
(1 row)

psql65=> EXPLAIN select distretto from comuni union select codice_fiscale from comuni;
NOTICE:  QUERY PLAN:

Unique  (cost=848.57 rows=0 width=0)
  ->  Sort  (cost=848.57 rows=0 width=0)
        ->  Append  (cost=848.57 rows=0 width=0)
                ->  Seq Scan on comuni  (cost=424.29 rows=8342 width=12)
                ->  Seq Scan on comuni  (cost=424.29 rows=8342 width=12)
EXPLAIN