tsm_system_rows
TABLESAMPLE method which accepts number of rows as a limit
tsm_system_rows : TABLESAMPLE method which accepts number of rows as a limit
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 4910 | tsm_system_rows | tsm_system_rows | 1.0 |
FUNC | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-dt- | No | Yes | No | Yes | no | yes |
| Relationships | |
|---|---|
| Need By | documentdb |
| See Also | faker dbt2 random tsm_system_time pg_mockable pgsqlmock pgtap omni_test |
Packages
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
This is a built-in contrib extension ship with the PostgreSQL kernel
Install
Create this extension with:
Usage
Provides the SYSTEM_ROWS table sampling method that returns exactly the specified number of rows.
TABLESAMPLE Method
SYSTEM_ROWS(count int) – maximum number of rows to return.
Examples
Performs block-level sampling (may exhibit clustering effects with small samples). Returns all rows if the table has fewer rows than requested. Does not support REPEATABLE.