Warning: mkdir(): No space left on device in /var/www/tgoop/post.php on line 37

Warning: file_put_contents(aCache/aDaily/post/sqlhub/--): Failed to open stream: No such file or directory in /var/www/tgoop/post.php on line 50
Data Science. SQL hub@sqlhub P.2140
SQLHUB Telegram 2140
This media is not supported in your browser
VIEW IN TELEGRAM
SQL СОВЕТ

Ловите тяжёлые запросы на ранней стадии через контролируемые анти-джоины.
Когда нужно узнать, какие записи *не имеют* соответствий в другой таблице, разработчики часто используют LEFT JOIN .

Гораздо быстрее использовать NOT EXISTS — он позволяет планировщику остановиться сразу, как только найдено первое совпадение, и эффективно задействует индексы.


select u.user_id
from users u
where not exists (
select 1
from logins l
where l.user_id = u.user_id
and l.created_at >= now() - interval '7 days'
);
👍147🔥7



tgoop.com/sqlhub/2140
Create:
Last Update:

SQL СОВЕТ

Ловите тяжёлые запросы на ранней стадии через контролируемые анти-джоины.
Когда нужно узнать, какие записи *не имеют* соответствий в другой таблице, разработчики часто используют LEFT JOIN .

Гораздо быстрее использовать NOT EXISTS — он позволяет планировщику остановиться сразу, как только найдено первое совпадение, и эффективно задействует индексы.


select u.user_id
from users u
where not exists (
select 1
from logins l
where l.user_id = u.user_id
and l.created_at >= now() - interval '7 days'
);

BY Data Science. SQL hub


Share with your friend now:
tgoop.com/sqlhub/2140

View MORE
Open in Telegram


Telegram News

Date: |

How to Create a Private or Public Channel on Telegram? According to media reports, the privacy watchdog was considering “blacklisting” some online platforms that have repeatedly posted doxxing information, with sources saying most messages were shared on Telegram. Concise Joined by Telegram's representative in Brazil, Alan Campos, Perekopsky noted the platform was unable to cater to some of the TSE requests due to the company's operational setup. But Perekopsky added that these requests could be studied for future implementation. As five out of seven counts were serious, Hui sentenced Ng to six years and six months in jail.
from us


Telegram Data Science. SQL hub
FROM American