# Please help in increasing the speed of query

**URL:** <https://forums.percona.com/t/please-help-in-increasing-the-speed-of-query/366>\
**Category:** Other MySQL® Questions\
**Created:** [June 22, 2007, 5:13am UTC](https://forums.percona.com/t/please-help-in-increasing-the-speed-of-query/366 "2007-06-22T05:13:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![clickshweta](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@clickshweta](https://forums.percona.com/u/clickshweta)\
**Post date:** [June 22, 2007, 5:13am UTC](https://forums.percona.com/t/please-help-in-increasing-the-speed-of-query/366/1 "2007-06-22T05:13:33Z")

</div>

☹

Hi i m using Innodb as default engine and my tables are not much heavy each table contains 70,000 rows but my performance os a query is very slow. My server RAM is 1 Gb and my innodb confifuration are follows

innodb\_additional\_mem\_pool\_size = 16M  
innodb\_buffer\_pool\_size = 500M  
innodb\_file\_io\_threads = 4M  
innodb\_log\_buffer\_size = 8M

my qeury that is taking long time is as follows

select distinct(start\_time), res.src\_addr, res.dst\_addr, res.src\_port, res.dst\_port, res.protocol, p0f.os, res.src\_pkt, res.dst\_pkt, res.src\_bytes,res.dst\_bytes from (select \* from argus where argus.start\_time \>‘2007-06-13 19:00:00’ and argus.start\_time \<‘2007-06-14 20:00:00’) res left join p0f on res.start\_time=p0f.p0f\_timestamp left join snort on res.start\_time=alert\_timestamp ;

Actually i m going to take the data from three tables argus,p0f and snort. between the particular timestamp. here is my explain query  
±—±------------±-----------±-----±--------------±— —±--------±---------------±------±-------------------- --+  
| id | select\_type | table | type | possible\_keys | key | key\_len | ref | rows | Extra |  
±—±------------±-----------±-----±--------------±— —±--------±---------------±------±-------------------- --+  
| 1 | PRIMARY | | ALL | NULL | NULL | NULL | NULL | 3814 | Using temporary |  
| 1 | PRIMARY | p0f | ref | time1 | time1 | 9 | res.start\_time | 1 | |  
| 1 | PRIMARY | snort | ref | time1 | time1 | 9 | res.start\_time | 1 | Using index; Distinct |  
| 2 | DERIVED | argus | ALL | st\_time | NULL | NULL | NULL | 78480 | Using where |  
±—±------------±-----------±-----±--------------±— —±--------±---------------±------±-------------------- --+

please tell me any solution as my data is going to increase alot in few days… and my this query is very important.

thanks  
shweta

---

<div class="post-metadata">

**Author:** ![babuno5](https://avatars.discourse-cdn.com/v4/letter/b/47e85d/32.png) [@babuno5](https://forums.percona.com/u/babuno5)\
**Post date:** [June 22, 2007, 6:05am UTC](https://forums.percona.com/t/please-help-in-increasing-the-speed-of-query/366/2 "2007-06-22T06:05:33Z")

</div>

select \* from argus where argus.start\_time \>‘2007-06-13 19:00:00’ and argus.start\_time \<‘2007-06-14 20:00:00’

In the above query if you could have an index on the start\_time it would speed the query

---

<div class="post-metadata">

**Author:** ![clickshweta](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@clickshweta](https://forums.percona.com/u/clickshweta)\
**Post date:** [June 22, 2007, 6:24am UTC](https://forums.percona.com/t/please-help-in-increasing-the-speed-of-query/366/3 "2007-06-22T06:24:57Z")

</div>

yes i have created the index u can check in explain stateements??? now i m getting an error

ERROR 1030 (HY000): Got error -1 from storage engine  
do u know whts the problem??

thanks

---

<div class="post-metadata">

**Author:** ![babuno5](https://avatars.discourse-cdn.com/v4/letter/b/47e85d/32.png) [@babuno5](https://forums.percona.com/u/babuno5)\
**Post date:** [June 22, 2007, 7:00am UTC](https://forums.percona.com/t/please-help-in-increasing-the-speed-of-query/366/4 "2007-06-22T07:00:40Z")

</div>

when are u getting this error ie at the time of creating the index??
