show partitions databaseName.tableName如何確認分區是否生效:explain dependency sqlselect * from table1 t1 where t1.date between '20151205' and '20151206' 說明:var between ‘a’ and ‘b’意思是var>=’a’ and var<=’b’inner join,分區過濾放在where后面,如 select * from table1 t1 join table t2 on (t1.id=t2.id) where t1.date between '20151205' and '20151206' and t2.date between '20151205' and '20151206' left join,左邊表的分區過濾放在where后面,右邊表分區過濾放在on后面,如 select * from table1 t1 left join table t2 on (t1.id=t2.id and t2.date between '20151205' and '20151206') where t1.date between '20151205' and '20151206' 說明:right join相反除了分區條件的放置之外其他的條件也類似,如t2.order_type=’3’放置在where后面則是在join之后進行過濾,放在on后面則是在join之前過濾
新聞熱點
疑難解答