久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<i id='0OGru'><tr id='0OGru'><dt id='0OGru'><q id='0OGru'><span id='0OGru'><b id='0OGru'><form id='0OGru'><ins id='0OGru'></ins><ul id='0OGru'></ul><sub id='0OGru'></sub></form><legend id='0OGru'></legend><bdo id='0OGru'><pre id='0OGru'><center id='0OGru'></center></pre></bdo></b><th id='0OGru'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='0OGru'><tfoot id='0OGru'></tfoot><dl id='0OGru'><fieldset id='0OGru'></fieldset></dl></div>

    <bdo id='0OGru'></bdo><ul id='0OGru'></ul>
    1. <legend id='0OGru'><style id='0OGru'><dir id='0OGru'><q id='0OGru'></q></dir></style></legend><tfoot id='0OGru'></tfoot>
    2. <small id='0OGru'></small><noframes id='0OGru'>

        是否可以在 MySQL 中使用基于函數(shù)的索引?

        Is it possible to have function-based index in MySQL?(是否可以在 MySQL 中使用基于函數(shù)的索引?)

        <i id='F4StW'><tr id='F4StW'><dt id='F4StW'><q id='F4StW'><span id='F4StW'><b id='F4StW'><form id='F4StW'><ins id='F4StW'></ins><ul id='F4StW'></ul><sub id='F4StW'></sub></form><legend id='F4StW'></legend><bdo id='F4StW'><pre id='F4StW'><center id='F4StW'></center></pre></bdo></b><th id='F4StW'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='F4StW'><tfoot id='F4StW'></tfoot><dl id='F4StW'><fieldset id='F4StW'></fieldset></dl></div>
          <bdo id='F4StW'></bdo><ul id='F4StW'></ul>

          <small id='F4StW'></small><noframes id='F4StW'>

          <legend id='F4StW'><style id='F4StW'><dir id='F4StW'><q id='F4StW'></q></dir></style></legend>
              <tbody id='F4StW'></tbody>

                <tfoot id='F4StW'></tfoot>
                  本文介紹了是否可以在 MySQL 中使用基于函數(shù)的索引?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我記得在 Oracle 中可以基于函數(shù)進(jìn)行索引,例如SUBSTRING(id,1,8).

                  I recall in Oracle it is possible to index based on a function, e.g. SUBSTRING(id,1,8).

                  MySQL 支持嗎?如果沒有,有沒有其他選擇?

                  Does MySQL support this? If not, is there is any alternative?

                  推薦答案

                  不,不是一般意義上的,我不相信 5.6(第一次編寫此答案時(shí)的最新版本)具有此功能.值得注意的是,8.0.13 及以上版本現(xiàn)在支持 功能索引,讓您無(wú)需使用下面描述的觸發(fā)方法即可實(shí)現(xiàn)所需.

                  No, not in a general sense, I don't believe even 5.6 (the latest version when this answer was first written) has this functionality. It's worth noting that 8.0.13 and above now support functional indexes, allowing you to achieve what you need without the trigger method described below.

                  如果您運(yùn)行的是舊版本的 mysql,則 可能只使用列的 領(lǐng)先 部分(此功能具有已經(jīng)存在很長(zhǎng)時(shí)間了),但不是從第二個(gè)或后續(xù)字符開始,或任何其他更復(fù)雜的函數(shù).

                  If you are running an older version of mysql, it is possible to only use the leading part of a column (this functionality has been around for a long time), but not one starting at the second or subsequent characters, or any other more complex function.

                  例如,以下內(nèi)容使用名稱的前五個(gè)字符創(chuàng)建索引:

                  For example, the following creates an index using the first five characters of a name:

                  create index name_first_five on cust_table (name(5));
                  

                  對(duì)于更復(fù)雜的表達(dá)式,您可以通過(guò)在其中包含可索引數(shù)據(jù)的另一個(gè)列來(lái)實(shí)現(xiàn)類似的效果,然后使用插入/更新觸發(fā)器來(lái)確保它被正確填充.

                  For more complex expressions, you can achieve a similar effect by having another column with the indexable data in it, then using insert/update triggers to ensure it's populated correctly.

                  除了浪費(fèi)空間用于冗余數(shù)據(jù)之外,這幾乎是一樣的.

                  Other than the wasted space for redundant data, that's pretty much the same thing.

                  而且,雖然它在技術(shù)上違反了 3NF,但可以通過(guò)使用觸發(fā)器來(lái)保持?jǐn)?shù)據(jù)同步來(lái)緩解這種情況(通常這樣做是為了提高性能).

                  And, although it technically violates 3NF, that's mitigated by the use of triggers to keep the data in sync (this is something that's often done for added performance).

                  這篇關(guān)于是否可以在 MySQL 中使用基于函數(shù)的索引?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數(shù)根據(jù) N 個(gè)先前值來(lái)決定接下來(lái)的 N 個(gè)行)
                  reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用選擇表達(dá)式的結(jié)果;條款?)
                  Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函數(shù)的 ignore 選項(xiàng)是忽略整個(gè)事務(wù)還是只是有問(wèn)題的行?) - IT屋-程序員軟件開發(fā)技
                  Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 時(shí)出錯(cuò),使用 for 循環(huán)數(shù)組)
                  pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 調(diào)用 o23.load 時(shí)發(fā)生錯(cuò)誤 沒有合適的驅(qū)動(dòng)程序)
                  How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數(shù)據(jù)庫(kù)表作為 Spark 數(shù)據(jù)幀讀取?)

                  <small id='QO34B'></small><noframes id='QO34B'>

                  <i id='QO34B'><tr id='QO34B'><dt id='QO34B'><q id='QO34B'><span id='QO34B'><b id='QO34B'><form id='QO34B'><ins id='QO34B'></ins><ul id='QO34B'></ul><sub id='QO34B'></sub></form><legend id='QO34B'></legend><bdo id='QO34B'><pre id='QO34B'><center id='QO34B'></center></pre></bdo></b><th id='QO34B'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='QO34B'><tfoot id='QO34B'></tfoot><dl id='QO34B'><fieldset id='QO34B'></fieldset></dl></div>

                      <bdo id='QO34B'></bdo><ul id='QO34B'></ul>
                        <tfoot id='QO34B'></tfoot>
                          <tbody id='QO34B'></tbody>
                        <legend id='QO34B'><style id='QO34B'><dir id='QO34B'><q id='QO34B'></q></dir></style></legend>
                          1. 主站蜘蛛池模板: 欧美在线一区二区三区 | jizz中国日本 | 91在线视频观看免费 | 久久久久久国产精品久久 | 午夜日韩 | 午夜理伦三级理论三级在线观看 | 四虎永久 | 成人精品一区 | 中文字幕 国产精品 | 亚洲日本免费 | 亚洲福利av| 亚洲v日韩v综合v精品v | 欧美a区 | 久久综合影院 | 国产精品免费在线 | 爱爱免费视频 | 国产三级精品三级在线观看四季网 | 亚洲精品自拍 | 国产日韩精品在线 | 色网在线播放 | 本道综合精品 | 亚洲国产精品一区二区第一页 | av在线免费观看网址 | 午夜精品一区二区三区在线视频 | 国产一级视频在线播放 | 亚洲一区二区精品视频 | 久久99精品国产99久久6男男 | 成年人黄色一级毛片 | 中文字幕亚洲视频 | 欧美国产一区二区 | 日韩视频一区二区三区 | 久久久久久久久久久91 | 国产区在线观看 | 中文字幕一区二区三区四区五区 | 国产乱码精品一区二三赶尸艳谈 | 二区三区在线观看 | 精品一区电影 | 欧美a级成人淫片免费看 | 国产精品日韩一区 | 精品一区二区三区不卡 | 亚洲欧美在线一区 |