表上999個非聚集索引——你怎麼看?

来源:http://www.cnblogs.com/woodytu/archive/2016/06/21/5603794.html
-Advertisement-
Play Games

對於數據獲取,如果查詢優化器在執行計劃里選擇了索引,那麼SQL Server里的每個索引可以提高你的查詢性能。但在另一方面,每個索引也會傷及你的性能,因為在INSERT,UPDATE和DELETE期間,每個索引需要被維護。因此對於你的工作量,儘可能創建少的索引非常重要——不然在寫操作期間,你會有巨大 ...


對於數據獲取,如果查詢優化器在執行計劃里選擇了索引,那麼SQL Server里的每個索引可以提高你的查詢性能。但在另一方面,每個索引也會傷及你的性能,因為在INSERT,UPDATE和DELETE期間,每個索引需要被維護。因此對於你的工作量,儘可能創建少的索引非常重要——不然在寫操作期間,你會有巨大的性能問題。

當你在表上定義了最大999個索引,SQL Server會如何反應?我從未在表上創建多大999個索引,因此詳細驗證下這個行為,並討論下它引入的所有副作用,會是個很好的鍛煉。

我們來創建一個可怕的表!

下麵代碼向你展示如何創建一個真正可怕的表:我剛創建了999次一樣的非聚集索引——反覆執行。

   1 SET STATISTICS IO, TIME ON
   2 GO
   3 
   4 CREATE DATABASE TooMuchIndexes
   5 GO
   6 
   7 USE TooMuchIndexes
   8 GO
   9 
  10 -- Create a simple table
  11 CREATE TABLE PerformanceKiller
  12 (
  13     Col1 INT IDENTITY(1, 1) PRIMARY KEY NOT NULL,
  14     Col2 INT NOT NULL,
  15     Col3 CHAR(100) NOT NULL
  16 )
  17 GO
  18 
  19 -- Let's insert some data
  20 DECLARE @i INT = 1
  21 
  22 WHILE (@i < 100001)
  23 BEGIN
  24     INSERT INTO PerformanceKiller(Col2, Col3)
  25     VALUES (@i, REPLICATE('x', 100))
  26 
  27     SET @i += 1
  28 END
  29 GO
  30 
  31 -- Generates the DDL statement for all indexes
  32 DECLARE @i INT = 1
  33 
  34 WHILE (@i < 1000)
  35 BEGIN
  36     PRINT 'CREATE INDEX idx_StupidIndex' + CAST(@i AS VARCHAR(3)) + ' ON PerformanceKiller(Col2)'
  37     SET @i += 1
  38 END
  39 GO
  40 
  41 -- Create 999 Non-Clustered Indexes...
  42 CREATE INDEX idx_StupidIndex1 ON PerformanceKiller(Col2)
  43 CREATE INDEX idx_StupidIndex2 ON PerformanceKiller(Col2)
  44 CREATE INDEX idx_StupidIndex3 ON PerformanceKiller(Col2)
  45 CREATE INDEX idx_StupidIndex4 ON PerformanceKiller(Col2)
  46 CREATE INDEX idx_StupidIndex5 ON PerformanceKiller(Col2)
  47 CREATE INDEX idx_StupidIndex6 ON PerformanceKiller(Col2)
  48 CREATE INDEX idx_StupidIndex7 ON PerformanceKiller(Col2)
  49 CREATE INDEX idx_StupidIndex8 ON PerformanceKiller(Col2)
  50 CREATE INDEX idx_StupidIndex9 ON PerformanceKiller(Col2)
  51 CREATE INDEX idx_StupidIndex10 ON PerformanceKiller(Col2)
  52 CREATE INDEX idx_StupidIndex11 ON PerformanceKiller(Col2)
  53 CREATE INDEX idx_StupidIndex12 ON PerformanceKiller(Col2)
  54 CREATE INDEX idx_StupidIndex13 ON PerformanceKiller(Col2)
  55 CREATE INDEX idx_StupidIndex14 ON PerformanceKiller(Col2)
  56 CREATE INDEX idx_StupidIndex15 ON PerformanceKiller(Col2)
  57 CREATE INDEX idx_StupidIndex16 ON PerformanceKiller(Col2)
  58 CREATE INDEX idx_StupidIndex17 ON PerformanceKiller(Col2)
  59 CREATE INDEX idx_StupidIndex18 ON PerformanceKiller(Col2)
  60 CREATE INDEX idx_StupidIndex19 ON PerformanceKiller(Col2)
  61 CREATE INDEX idx_StupidIndex20 ON PerformanceKiller(Col2)
  62 CREATE INDEX idx_StupidIndex21 ON PerformanceKiller(Col2)
  63 CREATE INDEX idx_StupidIndex22 ON PerformanceKiller(Col2)
  64 CREATE INDEX idx_StupidIndex23 ON PerformanceKiller(Col2)
  65 CREATE INDEX idx_StupidIndex24 ON PerformanceKiller(Col2)
  66 CREATE INDEX idx_StupidIndex25 ON PerformanceKiller(Col2)
  67 CREATE INDEX idx_StupidIndex26 ON PerformanceKiller(Col2)
  68 CREATE INDEX idx_StupidIndex27 ON PerformanceKiller(Col2)
  69 CREATE INDEX idx_StupidIndex28 ON PerformanceKiller(Col2)
  70 CREATE INDEX idx_StupidIndex29 ON PerformanceKiller(Col2)
  71 CREATE INDEX idx_StupidIndex30 ON PerformanceKiller(Col2)
  72 CREATE INDEX idx_StupidIndex31 ON PerformanceKiller(Col2)
  73 CREATE INDEX idx_StupidIndex32 ON PerformanceKiller(Col2)
  74 CREATE INDEX idx_StupidIndex33 ON PerformanceKiller(Col2)
  75 CREATE INDEX idx_StupidIndex34 ON PerformanceKiller(Col2)
  76 CREATE INDEX idx_StupidIndex35 ON PerformanceKiller(Col2)
  77 CREATE INDEX idx_StupidIndex36 ON PerformanceKiller(Col2)
  78 CREATE INDEX idx_StupidIndex37 ON PerformanceKiller(Col2)
  79 CREATE INDEX idx_StupidIndex38 ON PerformanceKiller(Col2)
  80 CREATE INDEX idx_StupidIndex39 ON PerformanceKiller(Col2)
  81 CREATE INDEX idx_StupidIndex40 ON PerformanceKiller(Col2)
  82 CREATE INDEX idx_StupidIndex41 ON PerformanceKiller(Col2)
  83 CREATE INDEX idx_StupidIndex42 ON PerformanceKiller(Col2)
  84 CREATE INDEX idx_StupidIndex43 ON PerformanceKiller(Col2)
  85 CREATE INDEX idx_StupidIndex44 ON PerformanceKiller(Col2)
  86 CREATE INDEX idx_StupidIndex45 ON PerformanceKiller(Col2)
  87 CREATE INDEX idx_StupidIndex46 ON PerformanceKiller(Col2)
  88 CREATE INDEX idx_StupidIndex47 ON PerformanceKiller(Col2)
  89 CREATE INDEX idx_StupidIndex48 ON PerformanceKiller(Col2)
  90 CREATE INDEX idx_StupidIndex49 ON PerformanceKiller(Col2)
  91 CREATE INDEX idx_StupidIndex50 ON PerformanceKiller(Col2)
  92 CREATE INDEX idx_StupidIndex51 ON PerformanceKiller(Col2)
  93 CREATE INDEX idx_StupidIndex52 ON PerformanceKiller(Col2)
  94 CREATE INDEX idx_StupidIndex53 ON PerformanceKiller(Col2)
  95 CREATE INDEX idx_StupidIndex54 ON PerformanceKiller(Col2)
  96 CREATE INDEX idx_StupidIndex55 ON PerformanceKiller(Col2)
  97 CREATE INDEX idx_StupidIndex56 ON PerformanceKiller(Col2)
  98 CREATE INDEX idx_StupidIndex57 ON PerformanceKiller(Col2)
  99 CREATE INDEX idx_StupidIndex58 ON PerformanceKiller(Col2)
 100 CREATE INDEX idx_StupidIndex59 ON PerformanceKiller(Col2)
 101 CREATE INDEX idx_StupidIndex60 ON PerformanceKiller(Col2)
 102 CREATE INDEX idx_StupidIndex61 ON PerformanceKiller(Col2)
 103 CREATE INDEX idx_StupidIndex62 ON PerformanceKiller(Col2)
 104 CREATE INDEX idx_StupidIndex63 ON PerformanceKiller(Col2)
 105 CREATE INDEX idx_StupidIndex64 ON PerformanceKiller(Col2)
 106 CREATE INDEX idx_StupidIndex65 ON PerformanceKiller(Col2)
 107 CREATE INDEX idx_StupidIndex66 ON PerformanceKiller(Col2)
 108 CREATE INDEX idx_StupidIndex67 ON PerformanceKiller(Col2)
 109 CREATE INDEX idx_StupidIndex68 ON PerformanceKiller(Col2)
 110 CREATE INDEX idx_StupidIndex69 ON PerformanceKiller(Col2)
 111 CREATE INDEX idx_StupidIndex70 ON PerformanceKiller(Col2)
 112 CREATE INDEX idx_StupidIndex71 ON PerformanceKiller(Col2)
 113 CREATE INDEX idx_StupidIndex72 ON PerformanceKiller(Col2)
 114 CREATE INDEX idx_StupidIndex73 ON PerformanceKiller(Col2)
 115 CREATE INDEX idx_StupidIndex74 ON PerformanceKiller(Col2)
 116 CREATE INDEX idx_StupidIndex75 ON PerformanceKiller(Col2)
 117 CREATE INDEX idx_StupidIndex76 ON PerformanceKiller(Col2)
 118 CREATE INDEX idx_StupidIndex77 ON PerformanceKiller(Col2)
 119 CREATE INDEX idx_StupidIndex78 ON PerformanceKiller(Col2)
 120 CREATE INDEX idx_StupidIndex79 ON PerformanceKiller(Col2)
 121 CREATE INDEX idx_StupidIndex80 ON PerformanceKiller(Col2)
 122 CREATE INDEX idx_StupidIndex81 ON PerformanceKiller(Col2)
 123 CREATE INDEX idx_StupidIndex82 ON PerformanceKiller(Col2)
 124 CREATE INDEX idx_StupidIndex83 ON PerformanceKiller(Col2)
 125 CREATE INDEX idx_StupidIndex84 ON PerformanceKiller(Col2)
 126 CREATE INDEX idx_StupidIndex85 ON PerformanceKiller(Col2)
 127 CREATE INDEX idx_StupidIndex86 ON PerformanceKiller(Col2)
 128 CREATE INDEX idx_StupidIndex87 ON PerformanceKiller(Col2)
 129 CREATE INDEX idx_StupidIndex88 ON PerformanceKiller(Col2)
 130 CREATE INDEX idx_StupidIndex89 ON PerformanceKiller(Col2)
 131 CREATE INDEX idx_StupidIndex90 ON PerformanceKiller(Col2)
 132 CREATE INDEX idx_StupidIndex91 ON PerformanceKiller(Col2)
 133 CREATE INDEX idx_StupidIndex92 ON PerformanceKiller(Col2)
 134 CREATE INDEX idx_StupidIndex93 ON PerformanceKiller(Col2)
 135 CREATE INDEX idx_StupidIndex94 ON PerformanceKiller(Col2)
 136 CREATE INDEX idx_StupidIndex95 ON PerformanceKiller(Col2)
 137 CREATE INDEX idx_StupidIndex96 ON PerformanceKiller(Col2)
 138 CREATE INDEX idx_StupidIndex97 ON PerformanceKiller(Col2)
 139 CREATE INDEX idx_StupidIndex98 ON PerformanceKiller(Col2)
 140 CREATE INDEX idx_StupidIndex99 ON PerformanceKiller(Col2)
 141 CREATE INDEX idx_StupidIndex100 ON PerformanceKiller(Col2)
 142 CREATE INDEX idx_StupidIndex101 ON PerformanceKiller(Col2)
 143 CREATE INDEX idx_StupidIndex102 ON PerformanceKiller(Col2)
 144 CREATE INDEX idx_StupidIndex103 ON PerformanceKiller(Col2)
 145 CREATE INDEX idx_StupidIndex104 ON PerformanceKiller(Col2)
 146 CREATE INDEX idx_StupidIndex105 ON PerformanceKiller(Col2)
 147 CREATE INDEX idx_StupidIndex106 ON PerformanceKiller(Col2)
 148 CREATE INDEX idx_StupidIndex107 ON PerformanceKiller(Col2)
 149 CREATE INDEX idx_StupidIndex108 ON PerformanceKiller(Col2)
 150 CREATE INDEX idx_StupidIndex109 ON PerformanceKiller(Col2)
 151 CREATE INDEX idx_StupidIndex110 ON PerformanceKiller(Col2)
 152 CREATE INDEX idx_StupidIndex111 ON PerformanceKiller(Col2)
 153 CREATE INDEX idx_StupidIndex112 ON PerformanceKiller(Col2)
 154 CREATE INDEX idx_StupidIndex113 ON PerformanceKiller(Col2)
 155 CREATE INDEX idx_StupidIndex114 ON PerformanceKiller(Col2)
 156 CREATE INDEX idx_StupidIndex115 ON PerformanceKiller(Col2)
 157 CREATE INDEX idx_StupidIndex116 ON PerformanceKiller(Col2)
 158 CREATE INDEX idx_StupidIndex117 ON PerformanceKiller(Col2)
 159 CREATE INDEX idx_StupidIndex118 ON PerformanceKiller(Col2)
 160 CREATE INDEX idx_StupidIndex119 ON PerformanceKiller(Col2)
 161 CREATE INDEX idx_StupidIndex120 ON PerformanceKiller(Col2)
 162 CREATE INDEX idx_StupidIndex121 ON PerformanceKiller(Col2)
 163 CREATE INDEX idx_StupidIndex122 ON PerformanceKiller(Col2)
 164 CREATE INDEX idx_StupidIndex123 ON PerformanceKiller(Col2)
 165 CREATE INDEX idx_StupidIndex124 ON PerformanceKiller(Col2)
 166 CREATE INDEX idx_StupidIndex125 ON PerformanceKiller(Col2)
 167 CREATE INDEX idx_StupidIndex126 ON PerformanceKiller(Col2)
 168 CREATE INDEX idx_StupidIndex127 ON PerformanceKiller(Col2)
 169 CREATE INDEX idx_StupidIndex128 ON PerformanceKiller(Col2)
 170 CREATE INDEX idx_StupidIndex129 ON PerformanceKiller(Col2)
 171 CREATE INDEX idx_StupidIndex130 ON PerformanceKiller(Col2)
 172 CREATE INDEX idx_StupidIndex131 ON PerformanceKiller(Col2)
 173 CREATE INDEX idx_StupidIndex132 ON PerformanceKiller(Col2)
 174 CREATE INDEX idx_StupidIndex133 ON PerformanceKiller(Col2)
 175 CREATE INDEX idx_StupidIndex134 ON PerformanceKiller(Col2)
 176 CREATE INDEX idx_StupidIndex135 ON PerformanceKiller(Col2)
 177 CREATE INDEX idx_StupidIndex136 ON PerformanceKiller(Col2)
 178 CREATE INDEX idx_StupidIndex137 ON PerformanceKiller(Col2)
 179 CREATE INDEX idx_StupidIndex138 ON PerformanceKiller(Col2)
 180 CREATE INDEX idx_StupidIndex139 ON PerformanceKiller(Col2)
 181 CREATE INDEX idx_StupidIndex140 ON PerformanceKiller(Col2)
 182 CREATE INDEX idx_StupidIndex141 ON PerformanceKiller(Col2)
 183 CREATE INDEX idx_StupidIndex142 ON PerformanceKiller(Col2)
 184 CREATE INDEX idx_StupidIndex143 ON PerformanceKiller(Col2)
 185 CREATE INDEX idx_StupidIndex144 ON PerformanceKiller(Col2)
 186 CREATE INDEX idx_StupidIndex145 ON PerformanceKiller(Col2)
 187 CREATE INDEX idx_StupidIndex146 ON PerformanceKiller(Col2)
 188 CREATE INDEX idx_StupidIndex147 ON PerformanceKiller(Col2)
 189 CREATE INDEX idx_StupidIndex148 ON PerformanceKiller(Col2)
 190 CREATE INDEX idx_StupidIndex149 ON PerformanceKiller(Col2)
 191 CREATE INDEX idx_StupidIndex150 ON PerformanceKiller(Col2)
 192 CREATE INDEX idx_StupidIndex151 ON PerformanceKiller(Col2)
 193 CREATE INDEX idx_StupidIndex152 ON PerformanceKiller(Col2)
 194 CREATE INDEX idx_StupidIndex153 ON PerformanceKiller(Col2)
 195 CREATE INDEX idx_StupidIndex154 ON PerformanceKiller(Col2)
 196 CREATE INDEX idx_StupidIndex155 ON PerformanceKiller(Col2)
 197 CREATE INDEX idx_StupidIndex156 ON PerformanceKiller(Col2)
 198 CREATE INDEX idx_StupidIndex157 ON PerformanceKiller(Col2)
 199 CREATE INDEX idx_StupidIndex158 ON PerformanceKiller(Col2)
 200 CREATE INDEX idx_StupidIndex159 ON PerformanceKiller(Col2)
 201 CREATE INDEX idx_StupidIndex160 ON PerformanceKiller(Col2)
 202 CREATE INDEX idx_StupidIndex161 ON PerformanceKiller(Col2)
 203 CREATE INDEX idx_StupidIndex162 ON PerformanceKiller(Col2)
 204 CREATE INDEX idx_StupidIndex163 ON PerformanceKiller(Col2)
 205 CREATE INDEX idx_StupidIndex164 ON PerformanceKiller(Col2)
 206 CREATE INDEX idx_StupidIndex165 ON PerformanceKiller(Col2)
 207 CREATE INDEX idx_StupidIndex166 ON PerformanceKiller(Col2)
 208 CREATE INDEX idx_StupidIndex167 ON PerformanceKiller(Col2)
 209 CREATE INDEX idx_StupidIndex168 ON PerformanceKiller(Col2)
 210 CREATE INDEX idx_StupidIndex169 ON PerformanceKiller(Col2)
 211 CREATE INDEX idx_StupidIndex170 ON PerformanceKiller(Col2)
 212 CREATE INDEX idx_StupidIndex171 ON PerformanceKiller(Col2)
 213 CREATE INDEX idx_StupidIndex172 ON PerformanceKiller(Col2)
 214 CREATE INDEX idx_StupidIndex173 ON PerformanceKiller(Col2)
 215 CREATE INDEX idx_StupidIndex174 ON PerformanceKiller(Col2)
 216 CREATE INDEX idx_StupidIndex175 ON PerformanceKiller(Col2)
 217 CREATE INDEX idx_StupidIndex176 ON PerformanceKiller(Col2)
 218 CREATE INDEX idx_StupidIndex177 ON PerformanceKiller(Col2)
 219 CREATE INDEX idx_StupidIndex178 ON PerformanceKiller(Col2)
 220 CREATE INDEX idx_StupidIndex179 ON PerformanceKiller(Col2)
 221 CREATE INDEX idx_StupidIndex180 ON PerformanceKiller(Col2)
 222 CREATE INDEX idx_StupidIndex181 ON PerformanceKiller(Col2)
 223 CREATE INDEX idx_StupidIndex182 ON PerformanceKiller(Col2)
 224 CREATE INDEX idx_StupidIndex183 ON PerformanceKiller(Col2)
 225 CREATE INDEX idx_StupidIndex184 ON PerformanceKiller(Col2)
 226 CREATE INDEX idx_StupidIndex185 ON PerformanceKiller(Col2)
 227 CREATE INDEX idx_StupidIndex186 ON PerformanceKiller(Col2)
 228 CREATE INDEX idx_StupidIndex187 ON PerformanceKiller(Col2)
 229 CREATE INDEX idx_StupidIndex188 ON PerformanceKiller(Col2)
 230 CREATE INDEX idx_StupidIndex189 ON PerformanceKiller(Col2)
 231 CREATE INDEX idx_StupidIndex190 ON PerformanceKiller(Col2)
 232 CREATE INDEX idx_StupidIndex191 ON PerformanceKiller(Col2)
 233 CREATE INDEX idx_StupidIndex192 ON PerformanceKiller(Col2)
 234 CREATE INDEX idx_StupidIndex193 ON PerformanceKiller(Col2)
 235 CREATE INDEX idx_StupidIndex194 ON PerformanceKiller(Col2)
 236 CREATE INDEX idx_StupidIndex195 ON PerformanceKiller(Col2)
 237 CREATE INDEX idx_StupidIndex196 ON PerformanceKiller(Col2)
 238 CREATE INDEX idx_StupidIndex197 ON PerformanceKiller(Col2)
 239 CREATE INDEX idx_StupidIndex198 ON PerformanceKiller(Col2)
 240 CREATE INDEX idx_StupidIndex199 ON PerformanceKiller(Col2)
 241 CREATE INDEX idx_StupidIndex200 ON PerformanceKiller(Col2)
 242 CREATE INDEX idx_StupidIndex201 ON PerformanceKiller(Col2)
 243 CREATE INDEX idx_StupidIndex202 ON PerformanceKiller(Col2)
 244 CREATE INDEX idx_StupidIndex203 ON PerformanceKiller(Col2)
 245 CREATE INDEX idx_StupidIndex204 ON PerformanceKiller(Col2)
 246 CREATE INDEX idx_StupidIndex205 ON PerformanceKiller(Col2)
 247 CREATE INDEX idx_StupidIndex206 ON PerformanceKiller(Col2)
 248 CREATE INDEX idx_StupidIndex207 ON PerformanceKiller(Col2)
 249 CREATE INDEX idx_StupidIndex208 ON PerformanceKiller(Col2)
 250 CREATE INDEX idx_StupidIndex209 ON PerformanceKiller(Col2)
 251 CREATE INDEX idx_StupidIndex210 ON PerformanceKiller(Col2)
 252 CREATE INDEX idx_StupidIndex211 ON PerformanceKiller(Col2)
 253 CREATE INDEX idx_StupidIndex212 ON PerformanceKiller(Col2)
 254 CREATE INDEX idx_StupidIndex213 ON PerformanceKiller(Col2)
 255 CREATE INDEX idx_StupidIndex214 ON PerformanceKiller(Col2)
 256 CREATE INDEX idx_StupidIndex215 ON PerformanceKiller(Col2)
 257 CREATE INDEX idx_StupidIndex216 ON PerformanceKiller(Col2)
 258 CREATE INDEX idx_StupidIndex217 ON PerformanceKiller(Col2)
 259 CREATE INDEX idx_StupidIndex218 ON PerformanceKiller(Col2)
 260 CREATE INDEX idx_StupidIndex219 ON PerformanceKiller(Col2)
 261 CREATE INDEX idx_StupidIndex220 ON PerformanceKiller(Col2)
 262 CREATE INDEX idx_StupidIndex221 ON PerformanceKiller(Col2)
 263 CREATE INDEX idx_StupidIndex222 ON PerformanceKiller(Col2)
 264 CREATE INDEX idx_StupidIndex223 ON PerformanceKiller(Col2)
 265 CREATE INDEX idx_StupidIndex224 ON PerformanceKiller(Col2)
 266 CREATE INDEX idx_StupidIndex225 ON PerformanceKiller(Col2)
 267 CREATE INDEX idx_StupidIndex226 ON PerformanceKiller(Col2)
 268 CREATE INDEX idx_StupidIndex227 ON PerformanceKiller(Col2)
 269 CREATE INDEX idx_StupidIndex228 ON PerformanceKiller(Col2)
 270 CREATE INDEX idx_StupidIndex229 ON PerformanceKiller(Col2)
 271 CREATE INDEX idx_StupidIndex230 ON PerformanceKiller(Col2)
 272 
              
您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 一,效果圖。 二,工程圖。 三,代碼。 AppDelegate.h AppDelegate.m ...
  • http://mp.weixin.qq.com/s?__biz=MzI5NTAxMzk4OA==&mid=209170198&idx=1&sn=97072f8bb5d7d2434112ae411cdf63df#rd 安裝時 需要輸入密碼 密碼為:www.ifunmac.com ...
  • 本文介紹一下自定義行間距的UILabel的高度如何獲取,需要藉助一下開源的UILabel控制項:TTTAttributedLabel 附下載地址 https://github.com/TTTAttributedLabel/TTTAttributedLabel 下載後,添加到工程裡面,導入頭文件 #im ...
  • 開始運行: 信息輸入: 身份證號查詢: 准考證號查詢: 信息刪除: 輸入錯誤信息: ...
  • 按照我之前安裝5.6的安裝方法(MySQL免安裝版下載與配置)安裝5.7的時候出現問題: mysql服務無法啟動,服務沒有報任何錯誤 其實在這學期開始學習mysql的時候,就聽老師同學說,登錄不了的問題,當時沒有在意,也是因為電腦上早就安裝了mysql5.6,也就沒有在意這個問題。這兩天win10系 ...
  • 本章將講解,Sybase下如何把含逗號字元串轉化為結果集。 示例如下: 把含有逗號的字元串,拆開放入結果集。 當用到臨時表時,可以直接把臨時表當做物理表一樣使用。 over ...
  • 說說複合索引 寫索引的博客太多了,一直不想動手寫,有一下兩個原因: 一是覺得有炒剩飯的嫌疑,有兄弟曾說:索引嗎,只要在查詢條件上建索引就行了,真的可以這麼暴力嗎? 二來覺得,索引是個非常大的話題,很難概括出所有的情況,你不整齣點新意來,倒是有抄襲照搬的嫌疑 既然寫了,就寫一點稍微不一樣的東西出來, ...
  • 今天在Java學習群里看到有人問:用alert能不能修改表結構?我第一反應是,alert是彈窗啊,怎麼修改表結構?後來再看才知道,是那人打錯了!我也暈了一下,還是記一下吧!alter是修改表結構的,alert()是彈出框! —————————————————————————————————————— ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...