File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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' ] ,
Original file line number Diff line number Diff 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 * {
You can’t perform that action at this time.
0 commit comments