
通过国外《High Performance MySQL》专家组的测试可以看出,根据主键进行查询的类似“SELECT ... FROM ... WHERE id = ...”的SQL语句(其中id为PRIMARY KEY),每秒钟能够处理10000次以上的查询,而普通的SELECT查询每秒只能处理几十次到几百次.
建议在mysql编译安装的时候, 把SphinxSE存储引擎(SE目录下)包含了:
patch -p1 < ../sphinx-0.98rc2.zhcn-support.patch
patch -p1 < ../fix-crash-in-excerpts.patch
cp -rf mysqlse ../mysql-5.1.26-rc/storage/sphinx
cd ../
- tar zxvf mysql-5.1.26-rc.tar.gz
- tar zxvf sphinx-0.9.8-rc2.tar.gz
- cd sphinx-0.9.8-rc2/
- patch -p1 < ../sphinx-0.98rc2.zhcn-support.patch
- patch -p1 < ../fix-crash-in-excerpts.patch
- cp -rf mysqlse ../mysql-5.1.26-rc/storage/sphinx
- cd ../
- cd mysql-5.1.26-rc/
- sh BUILD/autorun.sh
- ./configure --with-plugins=sphinx --prefix=/usr/local/mysql-search/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile
- make && make install
- cd ../
aptitude install libmysql++-dev libmysqlclient15-dev checkinstall
aptitude install g++ python-dev
./configure --prefix=/usr/local/sphinx --with-python --with-mysql --with-mmseg-includes=/usr/local/include/mmseg/ --with-mmseg-libs=/usr/local/lib/
- Sphinx 0.9.8-rc2 (r1234)
- Copyright (c) 2001-2008, Andrew Aksyonoff
- using config file '/usr/local/sphinx/etc/sphinx.conf'...
- indexing index 'test1'...
- collected 4 docs, 0.0 MB
- sorted 0.0 Mhits, 100.0% done
- total 4 docs, 184 bytes
- total 0.010 sec, 18400.00 bytes/sec, 400.00 docs/sec