最近客戶反應某個的頁面速度越來越慢,要十幾秒才能執行完.SQL並不複雜,大概就是:select 欄位 from 表1 where 欄位1 not in (select 欄位2 from 表2)其中表1和表2的數量都是幾萬條,資料量並不大, 技術人員檢查了索引,以及用not exists 和left join分別改寫都沒什麼改變.花了幾天時間,發現欄位1的欄位類型為int,欄位2的欄位類型為varchar.於是將欄位2的欄位類型改為int,結果執行速度在1秒內就完成。
[root@DBSVR01 e]# mysql -uroot -pEnter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)[root@DBSVR01 e]#=======================刪除user.user中值為NULL的,或更新NULL為test 1)delete from user where user is NULL
The type or namespace name 'MySql' could not be found.-------------if the IDE is vs.net then you copy the dll into C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 or the newest version of the .NET framework you have in the Framework folder, could be v1.
[root@DBSVR01 e]# service mysqld statusmysqld is stopped[root@DBSVR01 e]#==================================[root@DBSVR01 e]# service mysqld startInitializing MySQL database: Installing MySQL system tables...OKFilling help tables...OKTo start mysqld
http://dev.mysql.com/doc/refman/5.1/en/show-columns.htmlThe Key field indicates whether the column is indexed: If Key is empty, the column either is not indexed or is indexed only as a secondary column in a multiple-column, non-unique index. If Key
Source Installation Overview ---------------------------------- The basic commands you must execute to install a MySQL source distribution are: shell> groupadd mysql shell> useradd -g mysql mysql shell> gunzip <
在 MySQL 中,資料庫和表對就於那些目錄下的目錄和檔案。因而,作業系統的敏感性決定資料庫和表命名的大小寫敏感。這就意味著資料庫和表名在 Windows 中是大小寫不敏感的,而在大多數類型的 Unix 系統中是大小寫敏感的。奇怪的是列名與列的別名在所有的情況下均是忽略大小寫,而表的別名又是區分大小寫。要避免這個問題,你最好在定義資料庫命名規則的時候就全部採用小寫字母加底線的組合,而不使用任何的大寫字母。或者也可以強制以 -O lower_case_table_names=1 參數啟動