MySQL Forums
Forum List  »  Optimizer & Parser

Re: prepared statement query takes 3s for a few hundred lines - query issue
Posted by: Rick James
Date: December 07, 2015 01:17AM

> `longitude` double(16,14) NOT NULL,

Do not use (M,N) on FLOAT or DOUBLE. Furthermore, notice that you are implying that you can't go past +/-100 degrees of longitude.

> `country` varchar(3) COLLATE utf8_unicode_ci NOT NULL,
-->
`country` CHAR(3) CHARACTER SET ascii NOT NULL,

> `elevation` varchar(255)
I thought elevations were numeric? Also `bearing`.

EXPLAIN SELECT * FROM table;
is useless. Instead have the actual query after EXPLAIN.

Remove LEFT unless you need it. It is getting in the way of a particular optimization.

To `airspace_points` add
INDEX(airspace_id, grid)
INDEX(grid, airspace_id)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: prepared statement query takes 3s for a few hundred lines - query issue
943
December 07, 2015 01:17AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.