Skip to content

Commit

Permalink
perf: improve local table
Browse files Browse the repository at this point in the history
  • Loading branch information
lzf575 committed Nov 28, 2024
1 parent 68e1ed5 commit 627107c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions server/libs/ckdb/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,20 +497,18 @@ func (t *Table) MakeAggrLocalTableCreateSQL(orgID uint16, aggrInterval Aggregati
groupKeys = append(groupKeys, c.Name)
}
} else {
columns = append(columns, fmt.Sprintf("%sMerge(%s__agg) AS %s", getAggr(c), c.Name, c.Name))
columns = append(columns, fmt.Sprintf("finalizeAggregation(%s__agg) AS %s", c.Name, c.Name))
}
}

return fmt.Sprintf(`
CREATE VIEW IF NOT EXISTS %s
AS SELECT
%s
FROM %s
GROUP BY %s`,
FROM %s`,
tableLocal,
strings.Join(columns, ",\n"),
tableAgg,
strings.Join(groupKeys, ","))
tableAgg)
}

func (t *Table) MakeAggrGlobalTableCreateSQL(orgID uint16, aggrInterval AggregationInterval) string {
Expand Down

0 comments on commit 627107c

Please sign in to comment.