Re: Simple queries take forever to run

From: Michael Guerin <guerin(at)rentec(dot)com>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Simple queries take forever to run
Date: 2003-08-28 14:38:07
Message-ID: 3F4E13CF.7080202@rentec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Stephan Szabo wrote:

>On Wed, 27 Aug 2003, Michael Guerin wrote:
>
>
>
>>I'm running into some performance problems trying to execute simple
>>queries.
>>
>>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.
>>
>>
>
>IN(subquery) is known to run poorly in 7.3.x and earlier. 7.4 is
>generally much better (for reasonably sized subqueries) but in earlier
>versions you'll probably want to convert into an EXISTS or join form.
>
>
>
>
Something else seems to be going on, even switching to an exists clause
gives much better but poor performance.
count(*) where exists clause: Postgresql 19s, SQL Server <1s
count(*) where not exists: 23.3s SQL Server 1.5s

SQL Server runs on a dual 1.4 with 4gigs, win2k
Postgresql runs on a quad 900 with 8 gigs, sunos 5.8

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Vivek Khera 2003-08-28 14:38:54 Re: Hardware recommendations to scale to silly load
Previous Message Shridhar Daithankar 2003-08-28 14:23:13 Re: Hardware recommendations to scale to silly load