Opened 14 years ago

Closed 14 years ago

Last modified 13 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: no UI/UX: no

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 14 years ago.

Download all attachments as: .zip

Change History (5)

by Simon Law, 14 years ago

Attachment: mysql-spatial-index.patch added

comment:1 by jbronn, 14 years ago

milestone: 1.3
Owner: changed from nobody to jbronn
Status: newassigned

comment:2 by jbronn, 14 years ago

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 by jbronn, 14 years ago

(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 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

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