Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-performance by date

Next:From: Lorenzo AllegrucciDate: 2009-11-20 11:00:28
Subject: Re: Strange performance degradation
Previous:From: A. KretschmerDate: 2009-11-20 10:23:22
Subject: Re: Strange performance degradation

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group