some optimization?

From: Ciprian Popovici <ciprian(dot)popovici(at)integrare(dot)ro>
To: postgres <pgsql-general(at)postgresql(dot)org>
Subject: some optimization?
Date: 2002-09-19 11:14:52
Message-ID: 10214386024.20020919141452@integrare.ro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

select distinct on (code) id,code,active from objects \
where version<=2 and (process=17 or process=0) \
group by id,code,active,version \
order by code asc,active desc,version desc

I'm a bit green with Postgres. Is this query performant enough? Are
there things I can do to make it better (indexing, some other method?)
I have 'id' as the primary key and unique(code,version,active).

-- Ciprian Popovici <ciprian(dot)popovici(at)integrare(dot)ro>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jochem van Dieten 2002-09-19 11:18:11 Re: IN vs EXIIST
Previous Message Jan Weerts 2002-09-19 11:09:26 Re: IN vs EXIIST