Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#13967 closed (fixed)

GeoDjango always creates SPATIAL INDEXES when using MySQL

Reported by: Simon Law Owned by: jbronn
Component: GIS Version: 1.2
Severity: Keywords:
Cc: simon@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

If you are using MySQL, with the following model, GeoDjango will always create a spatial index for the point field:

from django.contrib.gis.db import models


class Places(models.Model):
    point = models.PointField(spatial_index=False)

This is because MySQLCreation.sql_indexes_for_field() does not check if it should do the work, unlike the other backends.

Included is a patch.

Attachments (1)

mysql-spatial-index.patch (651 bytes) - added by Simon Law 6 years ago.

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by Simon Law

Attachment: mysql-spatial-index.patch added

comment:1 Changed 6 years ago by jbronn

milestone: 1.3
Needs documentation: unset
Needs tests: unset
Owner: changed from nobody to jbronn
Patch needs improvement: unset
Status: newassigned

comment:2 Changed 6 years ago by jbronn

Resolution: fixed
Status: assignedclosed

(In [13443]) Fixed #13967 -- MySQL spatial backend now respects when spatial_index=False. Thanks, Simon Law, for bug report and patch.

comment:3 Changed 6 years ago by jbronn

(In [13444]) [1.2.X] Fixed #13967 -- MySQL spatial backend now respects when spatial_index=False. Thanks, Simon Law, for bug report and patch.

Backport of r13443 from trunk.

comment:4 Changed 5 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top