Bug #92967 | Slow query times with geospetial index | ||
---|---|---|---|
Submitted: | 26 Oct 2018 14:05 | Modified: | 8 Jan 2019 14:45 |
Reporter: | Georgi Georgiev | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: GIS | Severity: | S5 (Performance) |
Version: | 8.0.13 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | slow performance, spatial |
[26 Oct 2018 14:05]
Georgi Georgiev
[26 Oct 2018 16:36]
MySQL Verification Team
Thank for the bug report. Please attach here the file you mentioned? geo_bug_data.7z . Thanks.
[27 Oct 2018 6:10]
Georgi Georgiev
Hi Miguel, the file was bigger than 3MB so I uploaded it via sftp. The name is mysql-bug-data-92967 Sorry for not not mention it in my original message. Georgi
[1 Nov 2018 16:25]
MySQL Verification Team
Hi, I truly do not see the problem. GIS queries are very complex queries, their indices require lot's of memory with jumping to and fro. I get the same output from the query as you are getting: ....................................................... | 224190 | 35.127064 | -2.952244 | | 224189 | 35.127064 | -2.952244 | | 200681 | 35.127064 | -2.952244 | | 658625 | 35.127083 | -2.952250 | | 271123 | 35.127083 | -2.952250 | | 224188 | 35.127083 | -2.952250 | | 200680 | 35.127083 | -2.952250 | | 200679 | 35.127083 | -2.952250 | +--------+-----------+-----------+ The output for the time command for this query is quite good for me: real 0m16.644s user 0m0.011s sys 0m0.007s I am using 8 Gb for the buffer pool. The number of rows is the same as the one that you get: +----------+ | count(*) | +----------+ | 85832 | +----------+ Why do you think that 16 seconds is too long for a very complex GIS query on almost two million rows ??? Do you get much better results with some older versions and / or with some different execution route ???? I inspected the trace and it seems to me like the most optimal trace for this query. In short, I do not see what is the performance problem ???
[2 Dec 2018 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[8 Jan 2019 5:08]
seong yong kang
I have same issue with similar query. SELECT * FROM latlng WHERE st_within(coords, ST_Envelope(linestring(point(126.98019083521763, 37.484337719502655), point(127.01848022911464, 37.505619717376504)))) LIMIT 1; this query takes 0.01ms in mysql 5.7 but takes 0.50ms in mysql 8.0.13. latlng table has 4644662 records and using spatial index.
[8 Jan 2019 13:52]
MySQL Verification Team
When the difference is measured is milliseconds, that can be many causes. One table can be more fragmented than the other, data are further away from the spindle, etc, etc ...... Simply, a difference is too small.
[8 Jan 2019 14:45]
MySQL Verification Team
Performance that I have repeated is excellent for the very large number of rows and relatively large result set.
[8 Jan 2019 15:00]
seong yong kang
Although I mention 10ms above, actually less than 1ms. I can't service with 500ms delay in product. I guess it does not seem to use spatial index unlike explain results.
[8 Jan 2019 15:02]
MySQL Verification Team
If EXPLAIN shows that index is used, then it is definitely used !!!