A statement over a large table does not wait until the last row before showing the first. The grid asks for rows as it is scrolled, and everything downstream follows that: the row count on the status bar is what has been read so far, the search covers what has been read, and an export writes what has been read.
## What That Means While Reading
- Scrolling to the bottom of the grid reads on. A grid which stops halfway has not lost rows; it has not asked for them yet.
- Sorting, filtering and grouping in the grid apply to the rows retrieved so far; see [[Invantive Query Tool/Sorting and Filtering Rows|Sorting and Filtering Rows]].
- Searching does not read ahead: that would mean retrieving the remainder of an arbitrarily large answer on a keystroke. Searching again after scrolling covers what has been read by then.
## Stopping the Reading
Jumping far ahead of what has been read - to the end of the grid, for instance - reads everything in between first, and keeps the window busy while that lasts, so the window does not react. When it lasts longer than five seconds, a window titled "Working" appears. It names the operation, shows for how many seconds it has been running and how far it has come, such as "50 of 500 rows". "Cancel" or the Escape key ends the reading. Available from release 27.0.
Ending it stops the retrieval and nothing else:
- the rows read so far stay in the grid, with their sort, filter and grouping, and are what an export writes;
- the count on the status bar loses its `+`, since what has been read has become all there is;
- the statement is over at that point, so reading the rest means running it again.
## Asking for Less
The cheapest large answer is the one which is never fetched:
- name the columns instead of `select *`, which saves the platform the work and the connection the traffic;
- narrow with a `where` which the platform itself can apply, so the rows never travel;
- add a `limit` while writing the statement, and take it out when the statement is right;
- aggregate on the platform rather than in the grid; see [[Invantive Query Tool/Aggregating|Aggregating]].
## Watching It
The [[Invantive Query Tool/Progress|Progress]] panel shows how many rows have passed each step of a running statement, and its drawer lists the calls and the partitions behind a step. The [[Invantive Query Tool/Connection Monitor|Connection Monitor]] shows the calls themselves with what they cost in time and bytes. Together they answer the two questions a slow statement raises: is it many calls, or one call which is slow.
## Getting It Out
An export follows the view, so exporting a large answer means reading it to the end first. A large export which has to be repeated belongs in [[Invantive Script/Invantive Script|Invantive Script]], which writes the file straight from the statement without a grid in between, and in [[Invantive Data Hub/Invantive Data Hub|Invantive Data Hub]] for running it on a schedule.