当面试官问你有关sql优化的问题时,直接拿笔写给他:

8-select 9-distinct<column_list>

1-from left_table

3-<join_type> join right_table

2-on <join_condition>

4-where <where_condition>

5-with <cube | rollup>

6-group by <column_list>

7-having <having_condition>

10-order by <column_list>

11-limit/rownum <number>

再补充 在关键字段加索引,避免全表扫描,防止判断条件时隐式转换;深入点数据库分区,表分区。。

05-06 23:56