Code

Opened 4 years ago

Closed 4 years ago

Last modified 3 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 4 years ago.

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by sfllaw

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

  • milestone 1.3 deleted

Milestone 1.3 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.