Re: Efficiently searching for the most recent rows where a columnmatches any result from a different query

Поиск
Список
Период
Сортировка
От Nandakumar M
Тема Re: Efficiently searching for the most recent rows where a columnmatches any result from a different query
Дата
Msg-id CANcFUu5sbDrAEu47nhWcwe7uJ_MxxtVSkP_9ED8SXb4swh2tjw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Efficiently searching for the most recent rows where a columnmatches any result from a different query  (Nandakumar M <m.nanda92@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Nandakumar M
Дата:
Сообщение: Re: Efficiently searching for the most recent rows where a columnmatches any result from a different query
Следующее
От: Rick Otten
Дата:
Сообщение: blending fast and temp space volumes