Advertisement
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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement