Re: View based upon function won't use index on joins

From: Віталій Тимчишин <tivv00(at)gmail(dot)com>
To: Jonathan Foy <thefoy(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: View based upon function won't use index on joins
Date: 2009-11-20 10:30:33
Message-ID: 331e40660911200230r1fcb3fado95e8db21ecf33502@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

How about

CREATE OR REPLACE VIEW value_codes_view AS
select * from (
SELECT value_codes.id_nbr,
value_codes.id_qfr,
(ARRAY[val_1_cd_1, ... , val_2_cd_12])[i] as value_code,
(ARRAY[val_1_amt_1, ... , val_2_amt_12])[i] as value_amount,
FROM value_codes, generate_series(1,24) i) a
where value_code is not null and value_code != '';
?

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Lorenzo Allegrucci 2009-11-20 11:00:28 Re: Strange performance degradation
Previous Message A. Kretschmer 2009-11-20 10:23:22 Re: Strange performance degradation