mysql中使用not in速度慢的一種原因:欄位類型不符

最近客戶反應某個的頁面速度越來越慢,要十幾秒才能執行完.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秒內就完成。 

MySQL安裝辛路

MySQL系統反反覆複裝了好多次,包括虛擬機器和主機中。空白安裝還是很容易的,就是卸載麻煩必須按部就班。1、清除 伺服器配置 (可以回合組態程式清除)2、卸載程式(控制台中的卸載或直接運行安裝程式)3、清除服務資料,如果預設安裝應該在 (C:\Documents and Settings\All Users\Application

MySQL(5.0)匯出匯入

匯出命令: mysqldump -uroot -proot -R --databases DB1 DB2 --result-file=C:/123.sql --default-character-set=gbk-R : 在匯出的sql中包括儲存程式和自訂函數;--databases XXX : 包括幾個資料庫。CREATE DATABASE IF NOT EXISTS db_name 和 USE db_name語句包含在每個新資料庫前的輸出中;--result-file=XXX :

mysql ERROR 1045(28000)

[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 .net 串連 MySql時的錯誤

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.

mysql create table primary key auto_increment

mysql> create table ss(id int unsigned not null primary key auto_increment, user_name varchar(15) not null);Query OK, 0 rows affected (0.00 sec)mysql>  mysql> insert into ss(id,user_name) values(1, 'jojo');Query OK, 1 row affected (0.00 sec)

yum install mysql.i686

[root@DBSVR01 e]# yum install mysql.i686Loaded plugins: fastestmirror, securityLoading mirror speeds from cached hostfile * base: centos.ustc.edu.cn * extras: centos.ustc.edu.cn * updates: ftp.twaren.netSetting up Install ProcessResolving

start | stop mysql

[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

PHP學習筆記(2)—-Mysql與PHP的整合[原創]

  2004.11.02發表於blog.csdn.net/zxub  安裝好了PHP運行環境,也測試了一下,就想到了PHP與Mysql的整合。  先在php.ini檔案中找到extension_dir = "./"這麼一行,改為extension_dir = "g:\php5\ext",再找到;extension=php_mysql.dll這麼一行,將前面的分號去掉。找到mysql.default_host =這麼一行,=後面加上localhost,在下面的mysql.default_user

PHP學習筆記(4)—-Mysql使用者密碼的修改[原創]

  2004.11.04發表於blog.csdn.net/zxub  裝上mysql後,又用了phpmyadmin,就發現一個問題,用普通的sa使用者登陸的時候,不能建立資料庫。在第二次重裝了一遍php運行環境和mysql資料庫庫後,無意中發現可以建立資料庫了,怪啊,仔細一檢查,原來是在phpmyadmin裡的config.inc.php裡的第一個$cfg['Servers'][$i]['user']我沒有進行改變,還是預設的root,密碼為空白。  密碼為空白,這不就是漏洞嗎?上網一查,果然好

jbx添加加mysql驅動

jbx添加加mysql驅動2004-11-27 15:57:49  By: 磚頭  View: 517配置環境:1、Windows 20002、JBuilder 8 Enterprise3、MySQL 4.0.154、MySQL 的JDBC driver 3.0.9 ,下載網址:http://www.mysql.com/downloads/api-jdbc-stable.html本文對JBuilder和MySQL的安裝不在此累訴,重點從MySQL 的JDBC driver談起。       

jsp存取mysql中文資料結果為亂碼的解決方案(轉自自己以前的blog)

jsp存取mysql中文資料結果為亂碼的解決方案網上有很多這方面的資料,但很多要麼是零星的幾句,要麼是長篇大論從編碼的概念開始說起,我不是搞理論的,給自己的要求是會用就行。廢話不說,開始正題吧。我的開發環境是:XP-sp2,Tomcat5.0,jdk1.42,mysql4.0.21-nt在玩jsp時發現,jsp把中文資料存入mysql或者從mysql讀取出來顯示的是亂碼,無語,用百度搜了很多資料,解決問題。現總結一下。解決方案一:串連mysql時(無論在從mysql讀還是取資料的情況),指定使用

mysql key mul – 看不懂

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

mysql 備份之mysqldump 常用命令

truncate table 你的表名       // 刪除表格所有資料、重設種子標識 mysql/bin/c:\mysqldump -uusername -ppassword database>file.sql 匯出資料庫中所有的資料。c:\mysqldump -d -uusername -ppassword database>file.sql 匯出資料庫中所有表的結構c:\mysqldump -uusername -ppassword database

flash + amfphp + mysql 顯示中文解決方案

mysql部分:資料表和欄位的字元集對資料似乎沒有影響,無論我選擇utf8或者GB2312都能正常顯示 php部分:在mysql_connect後增加一句:mysql_query("SET NAMES 'utf8'");在amfphp目錄下的gateway.php檔案中,設定$gateway->setCharsetHandler("iconv", "uft-8",

MySQL中修改密碼及訪問限制設定詳解

  MySQL是一個真正的多使用者、多線程SQL資料庫伺服器。MySQL是以一個客戶機/伺服器結構的實現,它由一個伺服器精靈mysqld和很多不同的客戶程式和庫組成。由於其源碼的開放性及穩定性,且與網站流行編 揮鋂 PHP的完美結合,現在很多網站都利用其當作後端資料庫,使其獲得了廣泛應用。處於安全方面的考慮,需要為每一使用者賦於對不同資料庫的訪問限制,以滿足不同使用者的要求。下面就分別討論,供大家參考。      一、MySQL修改密碼方法總結

Mysql 5.0 For Linux 安裝手冊

 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 <

Hibernate+mysql 中文問題解決方案.

1, mysql安裝時設定字元集utf-8, jdbc驅動3.0.15以上.2. hibernate設定檔中,加上屬性<property name="connection.useUnicode">true</property><property name="connection.characterEncoding">UTF-8</property>3. web.xml設定Filter=================================

asp.net串連Mysql(connector/net 5.0)

 Mysql的connector/net5.0:http://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-5.0.6.zip/from/pick安裝好以後,點屬性,然後點尋找目標,點向上一層目錄,找到Binaries\.NET 2.0,然後將這個檔案複製到你的工程目錄下,一般這樣的DLL檔案會儲存到bin目錄下.在字碼頁裡輸入using

MySQL的大小寫敏感設定

在 MySQL 中,資料庫和表對就於那些目錄下的目錄和檔案。因而,作業系統的敏感性決定資料庫和表命名的大小寫敏感。這就意味著資料庫和表名在 Windows 中是大小寫不敏感的,而在大多數類型的 Unix 系統中是大小寫敏感的。奇怪的是列名與列的別名在所有的情況下均是忽略大小寫,而表的別名又是區分大小寫。要避免這個問題,你最好在定義資料庫命名規則的時候就全部採用小寫字母加底線的組合,而不使用任何的大寫字母。或者也可以強制以 -O lower_case_table_names=1 參數啟動

總頁數: 2483 1 .... 291 292 293 294 295 .... 2483 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.