Re: Inoptimal query plan for max() and multicolumn index

From: Vladimir Kulev <me(at)lightoze(dot)net>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Inoptimal query plan for max() and multicolumn index
Date: 2011-06-20 16:08:00
Message-ID: BANLkTinWEEyWTO5e0Zq5omAgO=OLZ_FJ7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Yes, exactly :)

On Mon, Jun 20, 2011 at 7:41 PM, Kevin Grittner
<Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
> I expect you're hoping for a plan similar to what this gives you?:
>
> explain analyze select greatest(
>  (select max(timestamp) from sms where number = '5502712'),
>  (select max(timestamp) from sms where number = '5802693'),
>  (select max(timestamp) from sms where number = '5801981'));

--
Vladimir Kulev
Mobile: +7 (921) 555-44-22

Jabber: me(at)lightoze(dot)net

Skype: lightoze

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2011-06-20 16:08:19 Re: bad plan: 8.4.8, hashagg, work_mem=1MB.
Previous Message Sushant Sinha 2011-06-20 16:04:00 Re: sequential scan unduly favored over text search gin index