a guest Aug 20th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- select count(*)
- from child
- tablesample bernoulli(5) -- If you're only after an estimate, TABLESAMPLE is your friend.
- left join parent on (child.parent_id = parent.id)
- where parent.id is null
RAW Paste Data