Skip to content

GitHub Issue #1607: Return selectRows total count without the rows query - #3215

Merged
cnathe merged 3 commits into
release26.7-SNAPSHOTfrom
26.7_fb_totalRowCount1607
Sep 30, 2026
Merged

cnathe merged 3 commits into
release26.7-SNAPSHOTfrom
26.7_fb_totalRowCount1607

Conversation

@cnathe

@cnathe cnathe commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Comment thread src/org/labkey/test/tests/ClientAPITest.java Outdated
cnathe added a commit to LabKey/labkey-ui-components that referenced this pull request Sep 30, 2026
…ery (#2081)

#### Rationale
LabKey/internal-issues#1607
See platform PR for rationale

#### Related Pull Requests
- LabKey/platform#8101
- #2081
- LabKey/limsModules#2501
- LabKey/testAutomation#3215

#### Changes
- withQueryModels.tsx update to reduce server side queries with the
combination of maxRows 0 and includeTotalCount true
cnathe added a commit to LabKey/platform that referenced this pull request Sep 30, 2026
…ery (#8101)

## Rationale
LabKey/internal-issues#1607

In the app React grid, we are sending two API requests: one for the page
of data and a second for the total row count. Because the total row
count API call sends maxRows: 1, we are getting an extra LIMIT 2 query
on the server side prior to the COUNT(*) query.

selectRows with maxRows=0 and an explicitly sent includeTotalCount=true
now becomes a count-only request. The server runs only COUNT(*)
(skipping the LIMIT 2 rows query) and returns rowCount, an empty rows
list, and metadata only if asked for. loadTotalCount in withQueryModels
now sends maxRows: 0 and includeMetadata: false.

## Related Pull Requests
- #8101
- LabKey/labkey-ui-components#2081
- LabKey/limsModules#2501
- LabKey/testAutomation#3215

## Changes
- SelectRowsAction treats maxRows=0 with an explicit
includeTotalCount=true as a count-only request
- a new count-only path runs only the COUNT(*) and returns rowCount,
metadata if requested
- adds loadTotalRowsOnly(), which checks read permission and runs
COUNT(*) without a rows query
- getAggregates() no longer returns empty when no rows query has run
@cnathe
cnathe merged commit d92bd75 into release26.7-SNAPSHOT Sep 30, 2026
7 checks passed
@cnathe
cnathe deleted the 26.7_fb_totalRowCount1607 branch September 30, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants