Re: Query runs very slowly in Postgres, but very fast in other DBMS - Mailing list pgsql-sql

From Tom Lane
Subject Re: Query runs very slowly in Postgres, but very fast in other DBMS
Date
Msg-id 7310.1113284590@sss.pgh.pa.us
Whole thread Raw
In response to Query runs very slowly in Postgres, but very fast in other DBMS  ("Andrus Moor" <eetasoft@online.ee>)
List pgsql-sql
"Andrus Moor" <eetasoft@online.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


pgsql-sql by date:

Previous
From: "Bill Lawrence"
Date:
Subject: Re: Getting the output of a function used in a where clause
Next
From: Krasimir Dimitrov
Date:
Subject: Re: Query runs very slowly in Postgres, but very fast in other DBMS