Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
6e4415c6
Commit
6e4415c6
authored
May 15, 2015
by
Simon Riggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docs for tablesample system_rows()
parent
9d366c1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
doc/src/sgml/tsm-system-rows.sgml
doc/src/sgml/tsm-system-rows.sgml
+50
-0
No files found.
doc/src/sgml/tsm-system-rows.sgml
0 → 100644
View file @
6e4415c6
<!-- doc/src/sgml/tsm-system-rows.sgml -->
<sect1 id="tsm-system-rows" xreflabel="tsm_system_rows">
<title>tsm_system_rows</title>
<indexterm zone="tsm-system-rows">
<primary>tsm_system_rows</primary>
</indexterm>
<para>
The <filename>tsm_system_rows</> module provides the tablesample method
<literal>SYSTEM_ROWS</literal>, which can be used inside the
<command>TABLESAMPLE</command> clause of a <command>SELECT</command>.
</para>
<para>
This tablesample method uses a linear probing algorithm to read sample
of a table and uses actual number of rows as limit (unlike the
<literal>SYSTEM</literal> tablesample method which limits by percentage
of a table).
</para>
<sect2>
<title>Examples</title>
<para>
Here is an example of selecting sample of a table with
<literal>SYSTEM_ROWS</>. First install the extension:
</para>
<programlisting>
CREATE EXTENSION tsm_system_rows;
</programlisting>
<para>
Then you can use it in <command>SELECT</command> command same way as other
tablesample methods:
<programlisting>
SELECT * FROM my_table TABLESAMPLE SYSTEM_ROWS(100);
</programlisting>
</para>
<para>
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).
</para>
</sect2>
</sect1>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment