pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
To: Michael Guerin <guerin@rentec.com>
To: pgsql-performance@postgresql.org
Subject: Re: Simple queries take forever to run
Date: Thu, 28 Aug 2003 09:29:01 +0800
Message-ID: <010101c36d03$c2dae240$2800a8c0@mars> (raw)
References: <3F4D2535.8050103@rentec.com>

> postgresql version 7.3.3
> .conf params changed from defaults.
> shared_buffers = 64000
> sort_mem = 64000
> fsync = false
> effective_cache_size = 400000
>
> ex. query: select * from x where id in (select id from y);
>
> There's an index on each table for id.  SQL Server takes <1s to return,
> postgresql doesn't return at all, neither does explain analyze.
> x has 1200673 rows
> y has 1282 rows
>
> It seems like its ignoring the index and not using enough memory.. any
> ideas?

This is a known problem in 7.3, it is much faster in 7.4b1.  This should be
very, very fast though, and do exactly the same thing:

select * from x where exists (select id from y where y.id=x.id);

Chris




view thread (11+ messages)  latest in thread

Message-ID: <010101c36d03$c2dae240$2800a8c0@mars>
Permalink:  ../010101c36d03$c2dae240$2800a8c0@mars/
Also on:    postgresql.org/message-id/010101c36d03$c2dae240$2800a8c0@mars

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: chriskl@familyhealth.com.au, guerin@rentec.com
  Subject: Re: Simple queries take forever to run
  In-Reply-To: <010101c36d03$c2dae240$2800a8c0@mars>
  References: <3F4D2535.8050103@rentec.com> <010101c36d03$c2dae240$2800a8c0@mars>

* 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