Re: PostgreSQL 9.1 : why is this query slow?

From: Joost Kraaijeveld <J(dot)Kraaijeveld(at)Askesis(dot)nl>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: PostgreSQL 9.1 : why is this query slow?
Date: 2011-11-28 16:57:49
Message-ID: 1322499469.3343.25.camel@panoramix.Askesis.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, 2011-11-28 at 17:42 +0100, Joost Kraaijeveld wrote:
> - Is there a way to rephrase the query that makes it faster?
This query goes faster (6224 ms, but I am not sure it gives the correct
answer as the result differs from my Java program):

select word, count (word) from unique_words
where
word in (select word from unique_words where
word in ( select word from unique_words where filetype = 'f')
and
filetype = 's')
and
filetype = 'n'
group by word

--
Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
web: www.askesis.nl

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2011-11-28 17:05:20 Re: PostgreSQL 9.1 : why is this query slow?
Previous Message Joost Kraaijeveld 2011-11-28 16:42:06 PostgreSQL 9.1 : why is this query slow?