The leading WITH clause, split by position; null when there is none.
Whether the main statement is SELECT DISTINCT.
Whether the main statement is a UNION / INTERSECT / EXCEPT.
Where the main statement (after any leading CTEs) starts.
The main statement's last top-level ORDER BY, from the keyword to the end of its list.
The caps the main statement itself carries, at its top level, in order.
A top-level FOR JSON or FOR XML, which makes the statement return a document, not rows.
Offset just after the main statement's first top-level SELECT [ALL | DISTINCT], where a
TOP n would go; null when the statement has no top-level SELECT (it is parenthesized,
or a bare VALUES list).
The statement analysed.
Where a trailing clause that must stay last starts: OPTION (…) on SQL Server, FOR UPDATE
/ FOR SHARE on PostgreSQL. Equal to the statement length when there is none.
What the paging and row-cap steps need to know about a statement, read from tokens so it works on SQL the AST parser cannot read. All offsets are positions in PagingShape.Statement.