TABLESAMPLE returns wrong number of rows?

后端 未结 4 1483
无人共我
无人共我 2020-12-17 20:18

I\'ve just discovered the TABLESAMPLE clause but surprisingly it doesn\'t return the number of rows i\'ve specified.

The table that i\'ve used has ~14M rows and i wa

4条回答
  •  有刺的猬
    2020-12-17 21:11

    I've observed the same.

    The page explanation definitely makes sense and rings a bell - You should see much more predictable row counts when your row size is fixed. Try it on a table with no nullable or variable-length columns.

    In fact I just used it to prove a theory about using it to update (you were probably spurred by the same question I was), and choosing TABLESAMPLE (50000 ROWS) actually affected 49,849 rows.

提交回复
热议问题