[PERFORM] Performance problems with DISTINCT ON

2009-10-03 Thread Sgarbossa Domenico
I need to retrieve the most recent prices per products from a price list table: CREATE TABLE listini_anagrafici ( id character varying(36) NOT NULL, articolo character varying(18), listino character varying(5), data_ent date, data_fin date, prezzo double precision, ultimo boolean DE

Re: [PERFORM] Performance problems with DISTINCT ON

2009-09-29 Thread Sgarbossa Domenico
Subject: Re: [PERFORM] Performance problems with DISTINCT ON Sgarbossa Domenico wrote: I need to retrieve the most recent prices per products from a price list table: select distinct on (articolo) articolo,data_ent,prezzo from listini_anagrafici order by articolo, data_ent desc but it

[PERFORM] Performance problems with DISTINCT ON

2009-09-28 Thread Sgarbossa Domenico
I need to retrieve the most recent prices per products from a price list table: CREATE TABLE listini_anagrafici ( id character varying(36) NOT NULL, articolo character varying(18), listino character varying(5), data_ent date, data_fin date, prezzo double precision, ultimo boolean DE