---
title: "Large Results"
description: "A statement over a large table can return more rows than a person looks at, often millions of them."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-query-tool-multi-platform/large-results
original: https://documentation.invantive.eu/en/docs/invantive-query-tool-multi-platform/large-results
updated: 2026-10-21T00:00:00Z
license: https://documentation.invantive.eu/en/
---

A statement over a large table can return more rows than a person looks at, often millions of them. The grid shows the first rows of a select statement as soon as they are read, and reads the next rows while the reader scrolls towards them. A result of tens of millions of rows therefore appears as fast as a small one, and takes memory only for the rows which were read. Reading while scrolling is available from release 28.0.

## Reading While Scrolling
A select statement which is run in a query tab with "Execute" returns after its first 500 rows. The grid then reads ahead, up to 2,000 rows beyond the last row on the screen. When fewer than 500 of the rows read are left below the last row on the screen, the grid reads the next ones. The rows are read in the background, so the window keeps answering.

As long as the grid has not read all rows of the result, it says so in two places:
- The strip under the grid shows a plus behind the number of rows read, such as "2.500+ Rows Affected" on a device which writes the thousands separator as a point.
- The messages pane shows the number of rows with a plus as well, such as "Select: 500+ row(s) in 960 ms."

The plus disappears once the grid has read the last row.

## Reading All Rows
Some actions are about the whole result, so the grid first reads the remaining rows, up to the limit below:
- "Ctrl+End", after which the last row of the result becomes the current row.
- A sort on a column, and a group, which sorts as well.
- A filter on a column, and the list of values which the filter of a column offers.
- The box "Find" with "Show Only Matches" switched on.
- An export which follows the view; see [[Invantive Query Tool Multi-Platform/Exporting Results|Exporting Results]].

While the grid reads, the strip under the grid counts the rows and the bar with the button "Cancel" is shown. "Cancel" stops the reading. The grid keeps the rows read so far and the messages pane says how many. A summary and "Hide empty columns" work on the rows read so far.

A new statement in the same query tab stops the reading, and so does closing the tab.

## The Limit
The grid holds at most 1,000,000 rows of a result. When it has read that many rows and the statement has more, it stops reading and the product warns in three places:
- The strip under the grid shows a plus behind the number of rows, such as "1.000.000+ Rows Affected".
- The messages pane says "Only the first" and the number of rows, followed by "rows of the result are shown."
- A local statement which uses the last result, such as `local export results`, gets a warning in the messages pane that it sees only the first rows of the result: "A local statement which uses the last result sees only its first" and the number of rows. The same warning appears while the grid has not read all rows yet.

The rows beyond the limit are not in the grid, so they are not in an export which follows the view either. A filter, a group or a summary works on the rows which are shown.

With the limit set to 5, a select of 12 rows from the data dictionary gives the strip "5+ Rows Affected" and the message "Only the first 5 rows of the result are shown.":
```sql
select r.value as id
from   range@datadictionary(12) r
```

## Where the Limit Does Not Apply
The limit is for the rows which a person looks at, so it is not applied where a file or a local statement depends on every row:
- The statements of a script run with "Execute All" are read in full.
- The formats which run the statement again, XML, JSON, NDJSON, JSON Data Set and the three SQL formats, write the complete result; see [[Invantive Query Tool Multi-Platform/Exporting Results|Exporting Results]].

## Changing the Limit
The environment variable `INVANTIVE_QUERY_TOOL_MAXIMUM_ROWS_SHOWN` sets the number of rows. It defaults to 1,000,000. A run in which the variable has the value `5` shows at most five rows. A higher limit only takes memory for the rows which are actually read. See [[Environment Variables]] for how an environment variable is set.

## 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 in the statement rather than in the grid; see [[Invantive Query Tool Multi-Platform/Grouping Results|Grouping Results]].

The panes "Progress" and "Connection Monitor" show how many rows have passed each step and which calls were made; see [[Invantive Query Tool Multi-Platform/Progress|Progress]] and [[Invantive Query Tool Multi-Platform/Connection Monitor|Connection Monitor]].

## Release Notes

- [Invantive Query Tool Multi-Platform](/en/release-notes/products/invantive-query-tool-multi-platform)
  - [new in 27.0](/en/release-notes/products/invantive-query-tool-multi-platform?step=new-in-27.0)

