I have 2 columnstore tables with similar schema.
both have Date in their shard key.
I have a functional requirement which needs aggregation of field spanning the dates in both tables.
My idea was to create view using UNION ALL, and use it.
Example:
SELECT SUM(ACTION)
FROM VIEW_NAME
WHERE dateColumn >= ‘$beginDate’ && dateColumn <= ‘$endDate’;
Will this query be optimal performant, and use the key within the tables, or will there be total table scan ?
If not, is there any suggestion to modifying the query ?