我的表只有兩列什麼是表,從表中選擇姓名,手機SELECT *之間的差異
`Select * from table` ----Execution time 10 second
Select name,mobile from table--Execution time 5 second
我的表只有兩列什麼是表,從表中選擇姓名,手機SELECT *之間的差異
`Select * from table` ----Execution time 10 second
Select name,mobile from table--Execution time 5 second
Select *
和Select Columns
沒有任何差別當您要掃描整個表 ..
下面的差異,當您使用由於羅不必要的列整另一個表的
1.掃描可突然出現wlookup成本超限
通過網絡
在你的情況2.發送數據的差異可能是由於鎖定,阻塞,內存壓力......一大堆reasons..but不因擴大所有列VS *
摘自康納爾坎寧安上相同..
這與正在看到的相反,他只有兩列。 – Cato
我澄清說,在差異部分 – TheGameiswar
你做'選擇*',然後'選擇名稱,移動'後? 如果是,那麼它是溫暖的緩存。你的數據在內存中。 第二個查詢運行得更快。
緩存表數據? (嘗試相反的順序。) – jarlh
看看這個帖子在這個相同的論壇http://stackoverflow.com/questions/3180375/select-vs-select-column – Petaflop
http://stackoverflow.com/questions/65512/which- is-faster-best-select-or-select-column1-colum2-column3-etc http://stackoverflow.com/questions/3180375/select-vs-select-column – Avishek