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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 != '';
?

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux