Re: Auto-tuning a VIEW? - Mailing list pgsql-performance

From PFC
Subject Re: Auto-tuning a VIEW?
Date
Msg-id op.s1smezd8cigqcu@peufeu.com
Whole thread Raw
In response to Auto-tuning a VIEW?  (Zoltan Boszormenyi <zboszor@dunaweb.hu>)
Responses Re: Auto-tuning a VIEW?
List pgsql-performance
> create view v1 (code,num) as
> select 'AAA',id from table1
> union
> select 'BBB',id from table2;

    As your rows are, by definition, distinct between each subquery, you
should use UNION ALL instead of UNION to save postgres the trouble of
hunting non-existing duplicates. This will save you a few sorts.

> select * from v1 where code||num = 'AAA2005000001';

    Why don't you use code='AAA' and num='2005000001' ?

pgsql-performance by date:

Previous
From: Zoltan Boszormenyi
Date:
Subject: Auto-tuning a VIEW?
Next
From: Zoltan Boszormenyi
Date:
Subject: Re: Auto-tuning a VIEW?