Hacker News new | past | comments | ask | show | jobs | submit login

Why shouldn't I be able to randomly sample a table? Some common use cases include queues and A/B tests.



You most definitely should be able to do that, and the SQL standard provides for this (sort of, kind of): TABLESAMPLE.

This applies specifically to exactly one table so the issue of dubious predicate pushdown never arises.

That said, I understand the SQL standard samples at the page level so you get a database-page-worth of results (8k in MSSQL) rather than a properly scattered sample. AIUI the standard allows for any other kind of sampling, but MSSQL doesn't support that (yet) but I believe postgres does. https://stackoverflow.com/questions/49061229/in-postgresql-h...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: