Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#13967 closed (fixed)

GeoDjango always creates SPATIAL INDEXES when using MySQL

Reported by: sfllaw 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 sfllaw 5 years ago.

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by sfllaw

comment:1 Changed 5 years ago by jbronn

  • milestone set to 1.3
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to jbronn
  • Patch needs improvement unset
  • Status changed from new to assigned

comment:2 Changed 5 years ago by jbronn

  • Resolution set to fixed
  • Status changed from assigned to closed

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

comment:3 Changed 5 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 4 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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