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

Re: Major differences between oracle and postgres performance - what can I do ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gary Cowell <gary_cowell(at)yahoo(dot)co(dot)uk>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Major differences between oracle and postgres performance - what can I do ?
Date: 2004-06-18 20:47:17
Message-ID: 25464.1087591637@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
=?iso-8859-1?q?Gary=20Cowell?= <gary_cowell(at)yahoo(dot)co(dot)uk> writes:
> So it seems the idea that oracle is dropping duplicate
> rows prior to the sort when using distinct may indeed
> be the case.

Okay.  We won't have any short-term solution for making DISTINCT do that,
but if you are on PG 7.4 you could get the same effect from using
GROUP BY: instead of
	select distinct version from vers where version is not null
try
	select version from vers where version is not null group by version
You should get a HashAggregate plan out of that, and I'd think it'd be
pretty quick when there are not many distinct values of version.

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Gary CowellDate: 2004-06-18 23:06:29
Subject: Re: Major differences between oracle and postgres performance - what can I do ?
Previous:From: Scott MarloweDate: 2004-06-18 18:58:27
Subject: Re: [BULK] Problems with vacuum!

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