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

diff --git a/doc/src/sgml/tsm-system-time.sgml b/doc/src/sgml/tsm-system-time.sgml
new file mode 100644 (file)
index 0000000..2343ab1
--- /dev/null
@@ -0,0 +1,51 @@
+
+
+
tsm_system_time
+
+  tsm_system_time
+
+  The tsm_system_time module provides the tablesample method
+  SYSTEM_TIME, 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 time in milliseconds as limit (unlike the
+  SYSTEM tablesample method which limits by percentage
+  of a table). This gives you some control over the length of execution
+  of your query.
+
+  Examples
+
+  
+   Here is an example of selecting sample of a table with
+   SYSTEM_TIME. First install the extension:
+  
+
+
+CREATE EXTENSION tsm_system_time;
+
+
+  
+   Then you can use it in a SELECT command the same way as
+   other tablesample methods:
+
+
+SELECT * FROM my_table TABLESAMPLE SYSTEM_TIME(1000);
+
+  
+
+  
+   The above command will return as large a sample of my_table as it can read in
+   1 second (or less if it reads whole table faster).
+  
+
+