From: Simon Riggs Date: Sat, 16 May 2015 01:44:53 +0000 (-0400) Subject: Add docs for tablesample system_rows() X-Git-Tag: REL9_5_ALPHA1~227 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e4415c6aa428132dd41c8bf23a0885fca0f2271;p=postgresql Add docs for tablesample system_rows() --- diff --git a/doc/src/sgml/tsm-system-rows.sgml b/doc/src/sgml/tsm-system-rows.sgml new file mode 100644 index 0000000000..0c2f1779c9 --- /dev/null +++ b/doc/src/sgml/tsm-system-rows.sgml @@ -0,0 +1,50 @@ + + + + tsm_system_rows + + + tsm_system_rows + + + + The tsm_system_rows module provides the tablesample method + SYSTEM_ROWS, which can be used inside the + TABLESAMPLE clause of a SELECT. + + + + This tablesample method uses a linear probing algorithm to read sample + of a table and uses actual number of rows as limit (unlike the + SYSTEM tablesample method which limits by percentage + of a table). + + + + Examples + + + Here is an example of selecting sample of a table with + SYSTEM_ROWS. First install the extension: + + + +CREATE EXTENSION tsm_system_rows; + + + + Then you can use it in SELECT command same way as other + tablesample methods: + + +SELECT * FROM my_table TABLESAMPLE SYSTEM_ROWS(100); + + + + + The above command will return a sample of 100 rows from the table my_table + (less if the table does not have 100 visible rows). + + + +