Skips the first N results (pagination).
SKIP <count>
## Overview SKIP discards the first N rows from the result set, passing only the remaining rows downstream. It is primarily used for pagination in combination with ORDER BY and LIMIT. SKIP can appear after RETURN for final output pagination, or inside a WITH clause for intermediate result manipulation. In DeltaForge, SKIP is evaluated after ORDER BY and before LIMIT in the execution pipeline. The engine must compute and sort all rows up to SKIP + LIMIT to produce the correct page, so deep pagination (large SKIP values) on large result sets can be expensive. ## Behavior - SKIP N discards the first N rows. If N exceeds the total row count, the result is empty. - SKIP 0 is a no-op and returns all rows. - When combined with ORDER BY, SKIP discards the first N rows in sorted order. The remaining rows (optionally truncated by LIMIT) form the output. - Inside a WITH clause, SKIP operates on the intermediate result. ## Limitations - Deep pagination (large SKIP values) requires materializing all preceding rows for sorting before discarding, which can be memory-intensive on large graphs. - SKIP does not support parameter expressions in all contexts. Use integer literals for maximum compatibility.
| Name | Type | Description |
|---|---|---|
count | Specifies the number of rows to skip from the beginning of the result set. Must be a non-negative integer literal or expression. A value of 0 skips nothing. |
-- Pagination: skip first 10 results, return next 5
USE my_zone.my_schema.my_graph
MATCH (n:Employee)
RETURN n.name AS name
ORDER BY n.name
SKIP 10
LIMIT 5;
-- Skip within WITH for intermediate pagination
USE my_zone.my_schema.my_graph
MATCH (n)
WITH n ORDER BY n.h_index DESC SKIP 5 LIMIT 10
RETURN n.name AS name, n.h_index AS h_index;
-- Skip the top result
USE my_zone.my_schema.my_graph
MATCH (a)-[]->(b)
RETURN a.name AS hub, count(b) AS connections
ORDER BY connections DESC
SKIP 1;
-- Full pagination pattern: page 3 of size 10
USE my_zone.my_schema.my_graph
MATCH (n:Employee)
RETURN n.name AS name, n.department AS dept
ORDER BY n.name
SKIP 20
LIMIT 10;