Limit
Description
The limit operator limits the number of output execution results. If a limit operator is added, not all rows are retrieved.
Typical Scenarios
Use a query statement containing the keyword limit.
Examples
Example: Use a query statement containing the keyword limit.
-- Prepare data. gaussdb=# CREATE TABLE t1 ( id int, number int); CREATE TABLE gaussdb=# INSERT INTO t1 VALUES (generate_series(1,50), 1); INSERT 0 50 gaussdb=# EXPLAIN SELECT * FROM t1 LIMIt 10 OFFSET 20; QUERY PLAN ---------------------------------------------------------- Limit (cost=0.29..0.44 rows=10 width=8) -> Seq Scan on t1 (cost=0.00..31.49 rows=10 width=8) (2 rows) -- Drop. gaussdb=# DROP TABLE t1;
In the preceding example, the output of the Limit operator is as follows.
Item |
Description |
---|---|
Limit |
Operator name. |
Seq Scan |
Name of an operator that scans the t1 table in sequence. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.