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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Slow update with simple query


  • From: Ragnar <gnari(at)hive(dot)is>
  • To: Arnaud Lesauvage <thewild(at)freesurf(dot)fr>
  • Cc: Jens Schipkowski <jens(dot)schipkowski(at)apus(dot)co(dot)at>, pgsql-performance(at)postgresql(dot)org
  • Subject: Re: Slow update with simple query
  • Date: Wed, 13 Dec 2006 14:49:00 +0000
  • Message-id: <1166021340(dot)6369(dot)103(dot)camel(at)localhost(dot)localdomain>

On mið, 2006-12-13 at 14:38 +0100, Arnaud Lesauvage wrote:
> Jens Schipkowski a écrit :
> > On Wed, 13 Dec 2006 13:23:41 +0100, Arnaud Lesauvage <thewild(at)freesurf(dot)fr>  
> >> Why is this query better than the other one ? Because it runs the  
> >> "(field IN ('some','other') AND field2 = 'Y')" once and then executes  
> >> the join with the resulting set ?
> > True. The Subselect in FROM clause will be executed once and will be  
> > joined using the condition at where clause. So your condition at t2 is not  
> > executed for each row in t1(2mio records) but for each row in t2(1k  
> > records). And the boolean value is already set during update.
> 
> OK Jens, thanks for clarifying this.
> I thought the planner could guess what to do in such cases.

don't worry, it will.
this is not your problem

gnari





Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group