Re: Performance regression from 8.3.7 to 9.0.3

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Claudio Freire <klaussfreire(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance regression from 8.3.7 to 9.0.3
Date: 2011-03-14 18:50:36
Message-ID: 27391.1300128636@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Claudio Freire <klaussfreire(at)gmail(dot)com> writes:
> CREATE OR REPLACE VIEW member_all_tags_v AS
> SELECT member_tags.member_id, member_tags.last_modification_date,
> member_tags.polarity, member_tags.tag_id, 'mr' AS source
> FROM member_tags
> UNION ALL
> SELECT member_profile_tags.member_id,
> member_profile_tags.last_modification_date, member_profile_tags.polarity,
> member_profile_tags.tag_id, 'profile' AS source
> FROM member_profile_tags;

Try casting those constants to text (or something) explicitly, ie
'mr'::text AS source etc. I forget at the moment why leaving them as
unknown literals interferes with optimization, but it does.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Haas 2011-03-14 19:40:33 Re: Table partitioning problem
Previous Message Merlin Moncure 2011-03-14 17:59:59 Re: Performance regression from 8.3.7 to 9.0.3