Re: sub-select makes query take too long - unusable

From: Sergey Aleynikov <sergey(dot)aleynikov(at)gmail(dot)com>
To: Mark Dueck <mark(at)dueck(dot)bz>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: sub-select makes query take too long - unusable
Date: 2009-11-22 08:06:18
Message-ID: a233edb60911220006p7d2c05c1x91c8ca838e8fafad@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hello,

SubPlan 2
-> Seq Scan on item_price (cost=0.00..423.30 rows=1 width=8)
(actual time=1.914..1.914 rows=0 loops=10669)
Filter: ((item_id = $1) AND (zone_id =
'OUsEaRcAA3jQrg42WHUm8A'::bpchar) AND (price_type = 0) AND
((size_name)::text = ($2)::text))

This means that, for every one of 10669 output rows, DB scanned whole
item_price table, spending 20.4 of 20.8 secs there. Do you have any
indexes there? Especially, on item_id column.

Best regards,
Sergey Aleynikov

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message afancy 2009-11-22 09:02:20 Re: Performance degrade running on multicore computer
Previous Message Mark Dueck 2009-11-22 05:13:47 sub-select makes query take too long - unusable