pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrus Moor <eetasoft@online.ee>
Cc: pgsql-sql@postgresql.org
Subject: Re: Query runs very slowly in Postgres, but very fast in other DBMS
Date: Tue, 12 Apr 2005 01:43:10 -0400
Message-ID: <7310.1113284590@sss.pgh.pa.us> (raw)
In-Reply-To: <d3er3k$2m2d$1@news.hub.org>
References: <d3er3k$2m2d$1@news.hub.org>

"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



view thread (6+ messages)  latest in thread

Message-ID: <7310.1113284590@sss.pgh.pa.us>
Permalink:  ../7310.1113284590@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7310.1113284590@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, eetasoft@online.ee
  Subject: Re: Query runs very slowly in Postgres, but very fast in other DBMS
  In-Reply-To: <7310.1113284590@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox