Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
f941d033
Commit
f941d033
authored
9 years ago
by
Simon Riggs
Browse files
Options
Downloads
Patches
Plain Diff
Add docs for tablesample system_time()
parent
f3d31185
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/sgml/tsm-system-time.sgml
+51
-0
51 additions, 0 deletions
doc/src/sgml/tsm-system-time.sgml
with
51 additions
and
0 deletions
doc/src/sgml/tsm-system-time.sgml
0 → 100644
+
51
−
0
View file @
f941d033
<!-- doc/src/sgml/tsm-system-time.sgml -->
<sect1 id="tsm-system-time" xreflabel="tsm_system_time">
<title>tsm_system_time</title>
<indexterm zone="tsm-system-time">
<primary>tsm_system_time</primary>
</indexterm>
<para>
The <filename>tsm_system_time</> module provides the tablesample method
<literal>SYSTEM_TIME</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 time in milliseconds as limit (unlike the
<literal>SYSTEM</literal> tablesample method which limits by percentage
of a table). This gives you some control over the length of execution
of your query.
</para>
<sect2>
<title>Examples</title>
<para>
Here is an example of selecting sample of a table with
<literal>SYSTEM_TIME</>. First install the extension:
</para>
<programlisting>
CREATE EXTENSION tsm_system_time;
</programlisting>
<para>
Then you can use it in a <command>SELECT</command> command the same way as
other tablesample methods:
<programlisting>
SELECT * FROM my_table TABLESAMPLE SYSTEM_TIME(1000);
</programlisting>
</para>
<para>
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).
</para>
</sect2>
</sect1>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment