Let's suppose that we have table with 5 fields.
CREATE TABLE mytable (I want vertica to create projections according to my example queries.
money int,
sourceA int,
sourceB int, sourceC int
);
Queries are always containing SUM(money) and different combinations of sourceA,sourceB,sourceC fields in SELECT / WHERE and GROUP BY sections. For example,
SELECT sourceA,sourceB,SUM(money) FROM mytable WHERE sourceC=15 GROUP BY sourceA,sourceB; SELECT sourceA,sourceB,sourceC SUM(money) FROM mytable WHERE 1 GROUP BY sourceA,sourceB,sourceC; SELECT sourceC,sourceB,sourceA SUM(money) FROM mytable WHERE 1 GROUP BY sourceC,sourceB,sourceA;What is the best practice to provide all possible queries? Should I write a script that will generate them? Or maybe it is not worth doing it?
Sorry for my English.
Thank you!