Hello,
I am observing a strange behavior in a query (mysql-cluster 7.2.4). The following query is extremely slow:
select convert_tz(timestamp,'+00:00','+1:00') as timestamp FROM sensor, acid_event force index(timestamp) LEFT JOIN ossim.plugin_sid ON plugin_sid.plugin_id=acid_event.plugin_id AND plugin_sid.sid=acid_event.plugin_sid WHERE sensor.sid = acid_event.sid order by timestamp desc limit 15;
---
15 rows in set (23 min 43.74 sec)
but if I change, for example, 'as timestamp' to 'as timestamp1' the query runs fine:
select convert_tz(timestamp,'+00:00','+1:00') as timestamp1 FROM sensor, acid_event force index(timestamp) LEFT JOIN ossim.plugin_sid ON plugin_sid.plugin_id=acid_event.plugin_id AND plugin_sid.sid=acid_event.plugin_sid WHERE sensor.sid = acid_event.sid order by timestamp desc limit 15;
---
15 rows in set (0.02 sec)
What could be the reason for this? Maybe I'm missing something?
More information about the query:
----+-------------+------------+--------+----------------+---------+---------+--------------------------------------------------------+---------+------------------------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+------------+--------+----------------+---------+---------+--------------------------------------------------------+---------+------------------------------------------------------------+
| 1 | SIMPLE | acid_event | ALL | NULL | NULL | NULL | NULL | 2826711 | Parent of 2 pushed join@1; Using temporary; Using filesort |
| 1 | SIMPLE | sensor | eq_ref | PRIMARY | PRIMARY | 4 | snort.acid_event.sid | 1 | |
| 1 | SIMPLE | plugin_sid | eq_ref | PRIMARY,search | PRIMARY | 8 | snort.acid_event.plugin_id,snort.acid_event.plugin_sid | 1 | Child of 'acid_event' in pushed join@1 |
+----+-------------+------------+--------+----------------+---------+---------+--------------------------------------------------------+---------+------------------------------------------------------------+
Thanks,
I am observing a strange behavior in a query (mysql-cluster 7.2.4). The following query is extremely slow:
select convert_tz(timestamp,'+00:00','+1:00') as timestamp FROM sensor, acid_event force index(timestamp) LEFT JOIN ossim.plugin_sid ON plugin_sid.plugin_id=acid_event.plugin_id AND plugin_sid.sid=acid_event.plugin_sid WHERE sensor.sid = acid_event.sid order by timestamp desc limit 15;
---
15 rows in set (23 min 43.74 sec)
but if I change, for example, 'as timestamp' to 'as timestamp1' the query runs fine:
select convert_tz(timestamp,'+00:00','+1:00') as timestamp1 FROM sensor, acid_event force index(timestamp) LEFT JOIN ossim.plugin_sid ON plugin_sid.plugin_id=acid_event.plugin_id AND plugin_sid.sid=acid_event.plugin_sid WHERE sensor.sid = acid_event.sid order by timestamp desc limit 15;
---
15 rows in set (0.02 sec)
What could be the reason for this? Maybe I'm missing something?
More information about the query:
----+-------------+------------+--------+----------------+---------+---------+--------------------------------------------------------+---------+------------------------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+------------+--------+----------------+---------+---------+--------------------------------------------------------+---------+------------------------------------------------------------+
| 1 | SIMPLE | acid_event | ALL | NULL | NULL | NULL | NULL | 2826711 | Parent of 2 pushed join@1; Using temporary; Using filesort |
| 1 | SIMPLE | sensor | eq_ref | PRIMARY | PRIMARY | 4 | snort.acid_event.sid | 1 | |
| 1 | SIMPLE | plugin_sid | eq_ref | PRIMARY,search | PRIMARY | 8 | snort.acid_event.plugin_id,snort.acid_event.plugin_sid | 1 | Child of 'acid_event' in pushed join@1 |
+----+-------------+------------+--------+----------------+---------+---------+--------------------------------------------------------+---------+------------------------------------------------------------+
Thanks,