Repository navigation
GitHub Issue #1607: Return selectRows total count without the rows query - #3215
Merged
Merged
Conversation
labkey-jeckels
approved these changes
Sep 28, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
https://github.com/LabKey/internal-issues/issues/1607
See platform PR for rationale
Related Pull Requests
Changes