Re: Slow plan for MAX/MIN or LIMIT 1?

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: Sam Wong <sam(at)hellosam(dot)net>
Cc: postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Slow plan for MAX/MIN or LIMIT 1?
Date: 2013-09-24 21:56:37
Message-ID: CAGTBQpYaBU4iYqfTN_Bx5JP026FC3n7kpfAg+Lu3kcAS9mJ=hQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Sep 24, 2013 at 6:24 AM, Sam Wong <sam(at)hellosam(dot)net> wrote:
> This event_log table has 4 million rows.
>
> “log_id” is the primary key (bigint),
>
> there is a composite index “event_data_search” over (event::text,
> insert_time::datetime).

I think you need to add log_id to that composite index to get pg to use it.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jeff Janes 2013-09-24 23:30:21 Re: Planner performance extremely affected by an hanging transaction (20-30 times)?
Previous Message Merlin Moncure 2013-09-24 21:49:10 Re: Slow plan for MAX/MIN or LIMIT 1?