Re: PostgreSQL 9.1 : why is this query slow? - Mailing list pgsql-performance

From Joost Kraaijeveld
Subject Re: PostgreSQL 9.1 : why is this query slow?
Date
Msg-id 1322499469.3343.25.camel@panoramix.Askesis.nl
Whole thread Raw
In response to PostgreSQL 9.1 : why is this query slow?  (Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>)
Responses Re: PostgreSQL 9.1 : why is this query slow?  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List 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


pgsql-performance by date:

Previous
From: Joost Kraaijeveld
Date:
Subject: PostgreSQL 9.1 : why is this query slow?
Next
From: "Kevin Grittner"
Date:
Subject: Re: PostgreSQL 9.1 : why is this query slow?