Answer the question
In order to leave comments, you need to log in
How long does it take Sphinx to search for a 10 million index?
Hello!
Recently there was a task to organize a search for 10 million records in a simple MySQL table. Put Sphinx, the index was created in about one or two minutes - that's good. Connected sphinxapi.php, created the simplest index search script. Everything is fine, but searching for 4-5 words takes about 1.8 seconds. Is it long?
Machine:
CPU: i5-2300 @ 2.80GHz
RAM: 4Gb
HDD: Western Digital WD5000 - 500 GB, 7200 rpm
Sphinx config file:
source address_name
{
type = mysql
sql_host = localhost
sql_user = root
sql_pass = password
sql_db = db_test
sql_port = 3306
sql_query = SELECT id, address FROM qa_table
sql_attr_uint = id
sql_query_info = SELECT address FROM qa_table WHERE id=$id
}
index address
{
source = address_name
path = /var/lib/sphinxsearch/data/address
morphology = stem_en
charset_type = utf-8
}
indexer
{
mem_limit = 128M
}
searchd
{
listen = 9312
read_timeout = 5
max_children = 30
pid_file = /var/run/sphinxsearch/searchd.pid
max_matches = 1000
preopen_indexes = 1
unlink_old = 1
workers = prefork
binlog_path = /var/lib/sphinxsearch/data
}
include('sphinxapi.php');
$cl = new SphinxClient();
$cl->SetServer( "localhost", 9312 );
$cl->SetMatchMode(SPH_MATCH_ANY);
$cl->SetLimits(0, 40);
$result = $cl->Query("8th St Bentonville Arkansas", "address");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question