On Wed, Nov 14, 2012 at 3:14 PM, Chris Pagnutti
<chris.pagnu...@gmail.com> wrote:
> The new index_together feature is great, but I think it's best to create an
> index on a table AFTER the table is filled, and assuming there won't be many
> new inserts.

AFAIK, this is an optimization advice applicable only for mostly-static tables.

> But in django, syncdb creates the index at the same time the
> table is created, and of course, the table is initially empty.  How does
> django deal with this?

nothing to deal with, this is normal behaviour in all SQL-based databases.

> Does it know to drop the index before inserting new
> records and re-create the index afterwards?

hell, no!, that would be hideously inefficient!

what could be workable is to do that only on really big batch inserts,
only if the indexes don't carry a restriction (like UNIQUE indexes),
and really part of an off-line operation, not in the normal HTTP
request processing.

-- 
Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to