<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                  聯合索引又叫復合索引。對于復合索引:Mysql從左到右的使用索引中的字段,一個查詢可以只使用索引中的一部份,但只能是最左側部分。例如索引是key index (a,b,c)。 可以支持a |   a,b| a,b,c 3種組合進行查找,但不支持 b,c進行查找 .當最左側字段是常量引用時,索引就十分有效。 ??? 兩個或更多個列上的索引被稱作復合索引。 ??? 利用索引中的附加列,您可以縮小搜索的范圍,但使用一個具有兩列的索引 不同于使用兩個單獨的索引。復合索引的結構與電話簿類似,人名由姓和名構成,電話簿首先按姓氏對進行排序,然后按名字對有相同姓氏的人進行排序。如果您知 道姓,電話簿將非常有用;如果您知道姓和名,電話簿則更為有用,但如果您只知道名不姓,電話簿將沒有用處。 ??? 所以說創建復合索引時,應該仔細考慮列的順序。對索引中的所有列執行搜索或僅對前幾列執行搜索時,復合索引非常有用;僅對后面的任意列執行搜索時,復合索引則沒有用處。 ??? 如:建立 姓名、年齡、性別的復合索引。 ??? create table test( ??? a int, ??? b int, ??? c int, ??? KEY a(a,b,c) ??? ); ??? 優: select \* from test where a=10 and b>50 ??? 差: select \* from test where a50 ??? 優: select \* from test order by a ??? 差: select \* from test order by b ??? 差: select \* from test order by c ??? 優: select \* from test where a=10 order by a ??? 優: select \* from test where a=10 order by b ??? 差: select \* from test where a=10 order by c ??? 優: select \* from test where a>10 order by a ??? 差: select \* from test where a>10 order by b ??? 差: select \* from test where a>10 order by c ??? 優: select \* from test where a=10 and b=10 order by a ??? 優: select \* from test where a=10 and b=10 order by b ??? 優: select \* from test where a=10 and b=10 order by c ??? 優: select \* from test where a=10 and b=10 order by a ??? 優: select \* from test where a=10 and b>10 order by b ??? 差: select \* from test where a=10 and b>10 order by c ? ? 索引原則 ??? 1.索引越少越好 ??? 原因:主要在修改數據時,第個索引都要進行更新,降低寫速度。 ??? 2.最窄的字段放在鍵的左邊 ??? 3.避免file sort排序,臨時表和表掃描。 small\_lei\_it 技術無止境,追求更高。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看