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

Re: Optimization idea

From: Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Vlad Arkhipov <arhipov(at)dc(dot)baikal(dot)ru>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Optimization idea
Date: 2010-04-29 08:21:13
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
2010/4/29 Robert Haas <robertmhaas(at)gmail(dot)com>:
> On Wed, Apr 28, 2010 at 5:37 AM, Vlad Arkhipov <arhipov(at)dc(dot)baikal(dot)ru> wrote:
>> Even if it will be done it does not solve the original issue. If I
>> understood you right there is now no any decent way of speeding up the query
>> select *
>> from t2
>> join t1 on t1.t = t2.t
>> where = X;
>> except of the propagating the value to the table t2 and createing and
>> index for this column?
> No, what I'm saying is that if X is any ANY() expression, you can get
> a faster plan in this case by writing:
> SELECT * FROM t2 JOIN t1 ON t1.t = t2.t WHERE = X;

SELECT * FROM t2 JOIN t1 ON t1.t = t2.t WHERE t2.t = X;

side note : You might want/need to improve statistics in the column
t2.t (in situation/distribution like this one)

> For me this is about 8x faster.
> ...Robert

Cédric Villemain

In response to

pgsql-performance by date

Next:From: Josh BerkusDate: 2010-04-30 22:50:54
Subject: Re: autovacuum strategy / parameters
Previous:From: Robert HaasDate: 2010-04-29 03:17:25
Subject: Re: Optimization idea

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