Thanks for pointing out the index improvement DEP Shai, I hadn't seen that yet.
It's important to note that right now, index names are not re-creatable in retrospect. They rely on the names of models and fields, that are free to be renamed. So a complete rethink will be needed if introspection can no longer be used for user-specified types of indexes. For example, maybe the user should choose the name, which they should make unique at the app level? Or if not, Django will need to either keep a record of the generated index name somewhere, or start renaming indexes to keep them up-to-date with the components in their names. What's the best way to proceed with the index name collision ticket #23577 <https://code.djangoproject.com/ticket/23577> at this point then? I can: 1. re-write my "use migration names in index names" branch <https://github.com/tomviner/django/compare/ticket_23577_with_poc_migration_name_fix> to allow index suffix names passed from migration operations? 2. or declare there's no consensus on the solution / we'll wait for Mark's index DEP - in which case, can I submit my tests <https://github.com/tomviner/django/compare/ticket_23577_with_tests> as xfails? Cheers, Tom On Thursday, 27 November 2014 20:44:28 UTC, Shai Berger wrote: > Hi, > > Just noted this thread, and I have two points: > > 1) Using the migration name in the index isn't really "predictable", and > isn't > even completely stable (the name changes when migrations are squashed), > unless > I'm missing something. > > 2) The current practice of identifying indexes by the columns they use is > sufficient now, but may not suffice when we have finer control over > indexes (Marc > Tamlyn is writing the DEP[1] for this). I can very easily see, for > example, > uses for two partial indexes on the same field (on PG, where partial > indexes > exist). > > I'm not sure we need fully predictable index names now, but my hunch is > that > we are going to need them down the road, and an explicitly-set suffix is a > lot > closer to what we'll need than a random one. > > My 2 cents, > Shai. > > > [1] https://github.com/django/deps/pull/6/files > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/c1e8088e-37d3-45d9-9cda-1b8f965d9124%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
