# Mysql Performance dashboard: slowest mysql queries

**URL:** <https://discuss.elastic.co/t/mysql-performance-dashboard-slowest-mysql-queries/60917>\
**Category:** Kibana\
**Created:** [September 19, 2016, 4:56pm UTC](https://discuss.elastic.co/t/mysql-performance-dashboard-slowest-mysql-queries/60917 "2016-09-19T16:56:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![KIVagant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kivagant/32/7182_2.png) [@KIVagant](https://discuss.elastic.co/u/KIVagant)\
**Post date:** [September 19, 2016, 4:56pm UTC](https://discuss.elastic.co/t/mysql-performance-dashboard-slowest-mysql-queries/60917/1 "2016-09-19T16:56:23Z")

</div>

Why the mysql queries is so strange in the table?

[![](http://dl2.joxi.net/drive/2016/09/19/0013/1215/898239/39/486e5e9efd.jpg) ](http://dl2.joxi.net/drive/2016/09/19/0013/1215/898239/39/486e5e9efd.jpg)

In the Packetbeat debug mode I see all normal queries. And they are absolute normal in the "Discover" tab, for example:

```
SELECT count(DISTINCT l0_.id) AS sclr_0 FROM token l0_

```

Can Logstash be a reason of that? It do nothing with the packets, just proxies to the Elastic Search.

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [September 19, 2016, 6:30pm UTC](https://discuss.elastic.co/t/mysql-performance-dashboard-slowest-mysql-queries/60917/2 "2016-09-19T18:30:22Z")

</div>

It looks like your field is analyzed, elasticsearch is tokenizing your queries and then running an aggregation on the split up chunks. If you have a query.raw field available that should give you the results you want. If not, you'll want to setup a mapping that's not\_analyzed for this field. See [https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html#\_field\_datatypes](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html#_field_datatypes) for more info.

---

<div class="post-metadata">

**Author:** ![monica](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/monica/32/3696_2.png) [@monica](https://discuss.elastic.co/u/monica)\
**Post date:** [September 19, 2016, 9:55pm UTC](https://discuss.elastic.co/t/mysql-performance-dashboard-slowest-mysql-queries/60917/3 "2016-09-19T21:55:01Z")

</div>

If you don't have valuable data, the easiest option would be to delete all data available in your packetbeat-\* index, and load the Packetbeat[index template](https://www.elastic.co/guide/en/beats/packetbeat/1.3/packetbeat-template.html). In the newer versions of Packetbeat, the index template is loaded automatically at startup if it wasn't loaded before. What version of Packetbeat are you using?

---

<div class="post-metadata">

**Author:** ![KIVagant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kivagant/32/7182_2.png) [@KIVagant](https://discuss.elastic.co/u/KIVagant)\
**Post date:** [September 20, 2016, 7:55am UTC](https://discuss.elastic.co/t/mysql-performance-dashboard-slowest-mysql-queries/60917/4 "2016-09-20T07:55:01Z")

</div>

First, my 'query' field wasn't analysed.

Today I have deleted all my indices and reinstalled Kibana, ElasticSearch, and PacketBeat to the newest stable versions. And after this I have all new indices patterns with stars instead of "event times", like "packetbeat-\*".  
After reinstallation I have conflict mapping with the "client\_location" field. [Reindexing](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#docs-reindex-rethrottle) wasn't help. I have deleted all indices again and started from zero, but I still have the conflict mapping.

And in the MysqlDashboard I have the same problem with split queries. And yes, now the "query" field is real analysed.

- Kibana v. 4.6.1
- Packetbeat v.1.3.1
- ElasticSearch v.2.4.0
- Kibana Beats Dashboards v.1.3.1

Screens:

- ![](https://us1.discourse-cdn.com/elastic/original/2X/5/58bf80aef60bfa017b5e166bcffbd1ef443b303b.jpg)
- ![](https://us1.discourse-cdn.com/elastic/original/2X/0/02fcb6ab30244629ee458904dba9af6ede3eb28d.jpg)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 10, 2016, 4:56pm UTC](https://discuss.elastic.co/t/mysql-performance-dashboard-slowest-mysql-queries/60917/5 "2016-10-10T16:56:30Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
