You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug#35894664: Assertion in Bitmap<64>::is_set(uint)
when forcing a spatial index scan.
Bug#36361834: Incorrect result of getting data from a
spatial index on column with SRID
Bug#36366621: MySQL crash when explaining a force a
spatial index containing column with SRID
Bug#36361834:
While setting up keys that could be used for covering
index scans, a "geometry" keypart makes an index not
covering. However, in case of innodb, a secondary index
is always extended with primary key. While setting up
the extended keypart spatial index is marked as covering.
With force index in effect, spatial index is the only
available index for optimizer to choose from. It picks
"index-skip-scan" for the table. However, innodb does
not support sequential scans on spatial indexes. This
leads to wrong results with no rows retrieved.
Bug#35894664 and Bug#36366621:
When choosing covering index scans, optimizer picks
the shortest covering key available. However, for
the case where spatial index is the only available
option, it fails to pick any index to do the index
scan which leads to problems later.
Solution to all these issues is that spatial indexes
should not be marked as indexes that could be used
for index only reads. There are a few inconsistencies
in the code w.r.t this. So we try to correct them.
While setting up keyparts, "geometry" field
makes the index not covering but having an extended
keypart which is not a geometry field makes the index
covering which should not be the case. So we now disable
spatial index for "index-only" reads irrespective of the
extended keyparts.
When introducing the change to disable "index-only" reads
for indexes having "geometry" fields as part of
Bug#19806196, "spatial index" was not expected to be
part of "prefix keys" as well. However, it was enabled
after some of the checks were changed/moved later.
This also led to an inconsistency.
E.g if the indexed "geometry" field is used as part of
the query, even though originally the spatial index was
indeed marked as covering (because of the extended
keyparts), while setting up the "geometry" field
(in set_field()), prefix keys for the field are removed
from the "covering_keys" keymap which made the spatial
index as not covering. This is also the reason we do
not see problems for cases where the indexed field is
part of the query.
So we fix this inconsistency by disabling "spatial indexes"
to be considered as prefix keys.
There was a check to disable picking a "spatial index" to
do covering index scan late in optimization phase. This is
removed now as it is taken care much earlier.
Change-Id: I44c04f79f35a270087a01c962f9ad35f5e3ad534
0 commit comments