Skip to content

Commit e1bf2d6

Browse files
Copilothotlong
andcommitted
Address code review feedback - fix spacing and add performance notes
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent bdd94d5 commit e1bf2d6

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

packages/spec/src/data/query.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ describe('QuerySchema - Window Functions', () => {
14411441
// Real-World Window Function Examples
14421442
// ============================================================================
14431443

1444-
it('should accept query for top N per group (SQL: ROW_NUMBER() OVER (PARTITION BY ...)) ', () => {
1444+
it('should accept query for top N per group (SQL: ROW_NUMBER() OVER (PARTITION BY ...))', () => {
14451445
const query: QueryAST = {
14461446
object: 'product',
14471447
fields: ['category_id', 'name', 'price'],

packages/spec/src/data/query.zod.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ export const SortNodeSchema = z.object({
5959
* - **array_agg**: Aggregate values into array (SQL: ARRAY_AGG(field))
6060
* - **string_agg**: Concatenate values (SQL: STRING_AGG(field, delimiter))
6161
*
62+
* Performance Considerations:
63+
* - COUNT(*) is typically faster than COUNT(field) as it doesn't check for nulls
64+
* - COUNT DISTINCT may require additional memory for tracking unique values
65+
* - Window aggregates (with OVER clause) can be more efficient than subqueries
66+
* - Large GROUP BY operations benefit from proper indexing on grouped fields
67+
*
6268
* @example
6369
* // SQL: SELECT region, SUM(amount) FROM sales GROUP BY region
6470
* {

0 commit comments

Comments
 (0)