title: Slow query Mysql 5.7 ordering by varchar column
body: <p>I've a linux VM with Mysql 5.7.19. Logging slow queries and <code>log-queries-not-using-indexes</code> I noticed this query:</p>
  
  <pre><code># Time: 2017-08-05T11:10:36.881359Z
  # User@Host: root[root] @ localhost [127.0.0.1]  Id:  2070
  # Query_time: 0.000381  Lock_time: 0.000145 Rows_sent: 1  Rows_examined: 35
  SET timestamp=1501931436;
   SELECT * FROM `cliente` order by denominazione;
  </code></pre>
  
  <p>Because I set <code>long_query_time = 5</code>, seems the query is logged because it doesn't use indexes. Explaning the query I've:</p>
  
  <pre><code>id  select_type     table   partitions  type    possible_keys   key     key_len     ref     rows    filtered    Extra   
  1   SIMPLE  cliente     NULL    ALL     NULL    NULL    NULL    NULL    35  100.00  Using filesort
  </code></pre>
  
  <p>This is my table ddl:</p>
  
  <pre><code>  CREATE TABLE `cliente` (
    `id` bigint(20) NOT NULL,
    `creatoDa` varchar(255) DEFAULT NULL,
    `dataInserimento` datetime DEFAULT NULL,
    `dataUltimaModifica` datetime DEFAULT NULL,
    `modificatoDa` varchar(255) DEFAULT NULL,
    `ENTITY_UID` varchar(36) NOT NULL,
    `version` int(11) DEFAULT NULL,
    `attivo` tinyint(1) NOT NULL DEFAULT '1',      
    `denominazione` varchar(255) NOT NULL,
    `email` varchar(255) DEFAULT NULL,
    `note` longtext,
    `password` varchar(255) NOT NULL,
    `username` varchar(255) NOT NULL,
    `dataUltimoPing` datetime DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  
  
   ALTER TABLE `cliente`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `UK_75j8vo25r1ws35vccamep965h` (`ENTITY_UID`),
    ADD UNIQUE KEY `UK_sgwkt4eif8lb1e5miakwnu7q9` (`username`),
    ADD KEY `idx_denominazione` (`denominazione`),
    ADD KEY `idx_attivo` (`attivo`)
  </code></pre>
  
  <p>I'm wondering why Mysql is not using index to sorting results considering that I've a index &lt;768 on denominazione (varchar(255)) field.</p>