例如,如果我有
CREATE VIEW viewTest1 AS
SELECT col_a, col_b, col_c, COUNT(1)
FROM table_name
GROUP BY col_a, col_b, col_c
SELECT * FROM viewTest1
另一个是
CREATE VIEW viewTest2 AS
SELECT col_a, col_b, col_c
FROM table_name
SELECT *, COUNT(1) FROM viewTest2
GROUP BY col_a, col_b, col_c
第二个跑得更快吗?为什么?
我的测试结果是第二个是 FASTER,我不明白。
谢谢