Re: Query runs very slowly in Postgres, but very fast in other DBMS

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andrus Moor" <eetasoft(at)online(dot)ee>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Query runs very slowly in Postgres, but very fast in other DBMS
Date: 2005-04-12 05:43:10
Message-ID: 7310.1113284590@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Andrus Moor" <eetasoft(at)online(dot)ee> writes:
> Seq Scan on rid (cost=0.00..28698461.07 rows=32201 width=14)
> Filter: (NOT (subplan))
> SubPlan
> -> Seq Scan on dok (cost=0.00..864.29 rows=10729 width=14)

> Is it possible to speed up this query is Postgres ?

Can you switch to int4 or int8 instead of NUMERIC(12)? I think that
we don't currently consider NUMERIC hashable, and you really need a
hash subplan here. In general NUMERIC is a bad choice if you're hot
about performance, anyway. Integers or floats would be probably two
orders of magnitude faster.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Krasimir Dimitrov 2005-04-12 06:33:16 Re: Query runs very slowly in Postgres, but very fast in other DBMS
Previous Message Ezequiel Tolnay 2005-04-12 05:36:38 Re: Query runs very slowly in Postgres, but very fast in other DBMS