Re: SELECT LIMIT 1 VIEW Performance Issue - Mailing list pgsql-performance

From Merlin Moncure
Subject Re: SELECT LIMIT 1 VIEW Performance Issue
Date
Msg-id 6EE64EF3AB31D5448D0007DD34EEB3417DD58A@Herge.rcsinc.local
Whole thread Raw
In response to SELECT LIMIT 1 VIEW Performance Issue  (K C Lau <kclau60@netvigator.com>)
Responses Re: SELECT LIMIT 1 VIEW Performance Issue
List 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

pgsql-performance by date:

Previous
From: Enrico Weigelt
Date:
Subject: Re: Massive delete performance
Next
From: K C Lau
Date:
Subject: Re: SELECT LIMIT 1 VIEW Performance Issue