Follow

select id from users where thing is not null => 80ms

select id from users where id in [...list of 1000 IDs...] => 80ms

select id from users where id in [...list of 1000 IDs...] OR thing is not null => 20s

select id from users where id in [...list of 1000 IDs...] OR id in (select id from users where thing is not null)` => 20s

select id from users where id in [...list of 1000 IDs...] UNION select id from users where thing is not null => 90ms

Sign in to participate in the conversation
Matthew’s tree house

This is a Mastodon community for dracos.co.uk.