Add docs for tablesample system_rows()
authorSimon Riggs
Sat, 16 May 2015 01:44:53 +0000 (21:44 -0400)
committerSimon Riggs
Sat, 16 May 2015 01:44:53 +0000 (21:44 -0400)
doc/src/sgml/tsm-system-rows.sgml [new file with mode: 0644]

diff --git a/doc/src/sgml/tsm-system-rows.sgml b/doc/src/sgml/tsm-system-rows.sgml
new file mode 100644 (file)
index 0000000..0c2f177
--- /dev/null
@@ -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).
+  
+
+