On Tue, Jun 17, 2014 at 10:26 PM, Lachlan Musicman <[email protected]> wrote: > tkc, > > Is that the default created when adding db_index=True of is that > something that I would do directly in postgres itself? > > cheers > L.
Yep, although obviously that won't work when you want a multi-column index. You want a multi column index when you want to speed up queries involving all the columns in that query. You can get multi column index by adding the appropriate Meta options on that model: https://docs.djangoproject.com/en/1.6/ref/models/options/#index-together There is also unique_together that allows UNIQUE indexes to be created. Bear in mind that whilst indexes speed up specific queries, they also slow down database modifications, as more indices have to be manipulated to reflect the changes. Having said that, not having the right indices can make your app blindingly slow, so it is important to get the balance right! Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django users" 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-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFHbX1Lm9VAzgbWgvZmg2hKtaLEa-TqktTAMfLh4K1ij0Kfpjw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

