The Little Guy Posted November 21, 2011 Share Posted November 21, 2011 What would cause this line: insert into searches (domain_id, ip, search_string) values ($domain_id, inet_aton('$ip'), '$string'); To take 0.06 seconds to run? It is only run one time. That takes up half the time it takes my 8 other queries to run (inserts and selects). Quote Link to comment Share on other sites More sharing options...
Alexv Posted November 21, 2011 Share Posted November 21, 2011 How does the table look like and how many records does it have? Quote Link to comment Share on other sites More sharing options...
fenway Posted November 21, 2011 Share Posted November 21, 2011 Other than too many indexes, there's little you can do. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted November 21, 2011 Author Share Posted November 21, 2011 I have 2 indexes on the table and ~130 row in it. +---------------+------------------+------+-----+-------------------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------------+------------------+------+-----+-------------------+----------------+ | search_id | int(10) unsigned | NO | PRI | NULL | auto_increment | | domain_id | int(10) unsigned | NO | MUL | NULL | | | ip | int(10) unsigned | YES | | NULL | | | search_string | char(50) | NO | | NULL | | | search_date | timestamp | NO | | CURRENT_TIMESTAMP | | +---------------+------------------+------+-----+-------------------+----------------+ +----------+------------+-----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +----------+------------+-----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | searches | 0 | PRIMARY | 1 | search_id | A | 134 | NULL | NULL | | BTREE | | | | searches | 1 | domain_id | 1 | domain_id | A | 2 | NULL | NULL | | BTREE | | | +----------+------------+-----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ Quote Link to comment Share on other sites More sharing options...
fenway Posted November 21, 2011 Share Posted November 21, 2011 Then that's how long it takes -- you're not exactly benchmarking here. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.