Re: Nested loop in simple query taking long time

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Henrik Zagerholm <henke(at)mac(dot)se>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Nested loop in simple query taking long time
Date: 2007-12-05 15:25:06
Message-ID: 21487.1196868306@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Henrik Zagerholm <henke(at)mac(dot)se> writes:
> Usually I can see what is wrong with queries but I can't figure out
> why this query is slow.

Seems the main problem is here:

> -> Bitmap Index Scan on tbl_archive_idx1
> (cost=0.00..1150.47 rows=8 width=0) (actual time=1505.456..1505.456
> rows=86053 loops=16)
> Index Cond: (tbl_share.pk_share_id =
> tbl_archive.fk_share_id)

Why is this scan finding so many more rows than the planner expects?
Perhaps increasing the stats targets on these columns would help it
make a better estimate.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message marcelo Cortez 2007-12-05 15:52:43 8.3 beta FATAL: invalid value for parameter "timezone_abbreviations": "Default"
Previous Message Ivan Sergio Borgonovo 2007-12-05 14:44:05 elegant way to fill a table with serial