Re: SELECT LIMIT 1 VIEW Performance Issue

From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: "K C Lau" <kclau60(at)netvigator(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: SELECT LIMIT 1 VIEW Performance Issue
Date: 2005-10-12 12:14:44
Message-ID: 6EE64EF3AB31D5448D0007DD34EEB3417DD58A@Herge.rcsinc.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

KC wrote:
>
> So I guess it all comes back to the basic question:
>
> For the query select distinct on (PlayerID) * from Player a where
> PlayerID='22220' order by PlayerId Desc, AtDate Desc;
> can the optimizer recognise the fact the query is selecting by the
primary
> key (PlayerID,AtDate), so it can skip the remaining rows for that
> PlayerID,
> as if LIMIT 1 is implied?
>
> Best regards, KC.

Hi KC, have you tried:
select * from player where playerid = '22220' and atdate < 9999999999
order by platerid desc, atdate desc limit 1;

??
Merlin

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message K C Lau 2005-10-12 13:00:15 Re: SELECT LIMIT 1 VIEW Performance Issue
Previous Message Enrico Weigelt 2005-10-11 21:48:50 Re: Massive delete performance