Re: Performance regression from 8.3.7 to 9.0.3 - Mailing list pgsql-performance

From Tom Lane
Subject Re: Performance regression from 8.3.7 to 9.0.3
Date
Msg-id 27391.1300128636@sss.pgh.pa.us
Whole thread Raw
In response to Re: Performance regression from 8.3.7 to 9.0.3  (Claudio Freire <klaussfreire@gmail.com>)
List pgsql-performance
Claudio Freire <klaussfreire@gmail.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

pgsql-performance by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Performance regression from 8.3.7 to 9.0.3
Next
From: Robert Haas
Date:
Subject: Re: Table partitioning problem