Re: Efficiently searching for the most recent rows where a columnmatches any result from a different query - Mailing list pgsql-performance

From Nandakumar M
Subject Re: Efficiently searching for the most recent rows where a columnmatches any result from a different query
Date
Msg-id CANcFUu5sbDrAEu47nhWcwe7uJ_MxxtVSkP_9ED8SXb4swh2tjw@mail.gmail.com
Whole thread Raw
In response to Re: Efficiently searching for the most recent rows where a columnmatches any result from a different query  (Nandakumar M <m.nanda92@gmail.com>)
List pgsql-performance
Hi,

Correction in the query. I missed to add limit 10 in the outer most query..

> select * from posts where posts.author_id in (select id from users
> where id in (select friend_id from user_friend where user_id = 1) and
> last_posted_time is not null order by last_posted_time desc limit 10);
>

select * from posts where posts.author_id in (select id from users
where id in (select friend_id from user_friend where user_id = 1) and
last_posted_time is not null order by last_posted_time desc limit 10)
order by post_id desc limit 10;

Regards,
Nanda


pgsql-performance by date:

Previous
From: Nandakumar M
Date:
Subject: Re: Efficiently searching for the most recent rows where a columnmatches any result from a different query
Next
From: Rick Otten
Date:
Subject: blending fast and temp space volumes