Skip site navigation (1) Skip section navigation (2)

Re: Hash join on int takes 8..114 seconds

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: PFC <lists(at)peufeu(dot)com>
Cc: Andrus <kobruleht2(at)hot(dot)ee>, "Richard Huxton" <dev(at)archonet(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Hash join on int takes 8..114 seconds
Date: 2008-11-21 20:07:02
Message-ID: 11835.1227298022@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
PFC <lists(at)peufeu(dot)com> writes:
> Index on orders_products( product_id ) and orders_products( order_id ):
> 	=> Same plan

> 	Note that in this case, a smarter planner would use the new index to  
> perform a BitmapAnd before hitting the heap to get the rows.

Considering that the query has no constraint on
orders_products.order_id, I'm not sure what you think the extra index is
supposed to be used *for*.

(Well, we could put orders as the outside of a nestloop and then we'd
have such a constraint, but with 30000 orders rows to process that plan
would lose big.)

(And yes, the planner did consider such a plan along the way.
See choose_bitmap_and.)

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: AndrusDate: 2008-11-21 20:08:45
Subject: Re: Hash join on int takes 8..114 seconds
Previous:From: Alvaro HerreraDate: 2008-11-21 19:48:05
Subject: Re: Hash join on int takes 8..114 seconds

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group