Re: Django, initial data and custom SQL

2009-02-12 Thread Ludvig Ericson
On Feb 12, 2009, at 11:53, Russell Keith-Magee wrote: > On Thu, Feb 12, 2009 at 4:49 PM, Ludvig Ericson >> One solution, which is entirely backwards-compatible, would be to say >> that "if you want your custom SQL to run after indices creation, name >> files '*.post.sql,'" or something like that.

Re: Django, initial data and custom SQL

2009-02-12 Thread Russell Keith-Magee
On Thu, Feb 12, 2009 at 5:21 PM, Johan Bergström wrote: > >> After pondering some more, I realized the docs actually say "initial >> SQL data", and so I'm not sure if this change is actually a good idea >> or not. > > I also realize that the docs says "initial data" but since

Re: Django, initial data and custom SQL

2009-02-12 Thread Russell Keith-Magee
On Thu, Feb 12, 2009 at 4:49 PM, Ludvig Ericson wrote: > > On Feb 12, 2009, at 07:48, Russell Keith-Magee wrote: >> On Thu, Feb 12, 2009 at 2:54 PM, Ludvig Ericson >> wrote: >>> >>> I fail to see how "it has consequences for existing code", as

Re: Django, initial data and custom SQL

2009-02-12 Thread Johan Bergström
Hello folks, On Feb 12, 8:49 am, Ludvig Ericson wrote: > On Feb 12, 2009, at 07:48, Russell Keith-Magee wrote: > > > On Thu, Feb 12, 2009 at 2:54 PM, Ludvig Ericson > > wrote: > > >> I fail to see how "it has consequences for existing code",

Re: Django, initial data and custom SQL

2009-02-11 Thread Ludvig Ericson
On Feb 12, 2009, at 07:48, Russell Keith-Magee wrote: > On Thu, Feb 12, 2009 at 2:54 PM, Ludvig Ericson > wrote: >> >> I fail to see how "it has consequences for existing code", as Russell >> put it. > > It has consequences because you are proposing to change the order

Re: Django, initial data and custom SQL

2009-02-11 Thread Russell Keith-Magee
On Thu, Feb 12, 2009 at 2:54 PM, Ludvig Ericson wrote: > > Feb 11, Johan Bergström: >> I took the liberty of creating a ticket with attached patch at: >> http://code.djangoproject.com/ticket/10236 > > I fail to see how "it has consequences for existing code", as Russell

Re: Django, initial data and custom SQL

2009-02-11 Thread Ludvig Ericson
Feb 11, Johan Bergström: > I took the liberty of creating a ticket with attached patch at: > http://code.djangoproject.com/ticket/10236 I fail to see how "it has consequences for existing code", as Russell put it. I did discuss this with Bergström, and we came to the conclusion that it

Re: Django, initial data and custom SQL

2009-02-11 Thread Johan Bergström
On Feb 10, 5:07 pm, Johan Bergström wrote: > Hey, > > On Feb 10, 4:51 pm, "ludvig.ericson" wrote: > > > > > > > On Feb 10, 1:13 pm, Johan Bergström wrote: > > > > Since Django executes my custom SQL before creating indexes,

Re: Django, initial data and custom SQL

2009-02-10 Thread Johan Bergström
Hey, On Feb 10, 4:51 pm, "ludvig.ericson" wrote: > On Feb 10, 1:13 pm, Johan Bergström wrote: > > > Since Django executes my custom SQL before creating indexes, it's > > impossible to achieve something that hooks into initdb/syncdb. I know > > that

Re: Django, initial data and custom SQL

2009-02-10 Thread ludvig.ericson
On Feb 10, 1:13 pm, Johan Bergström wrote: > Since Django executes my custom SQL before creating indexes, it's > impossible to achieve something that hooks into initdb/syncdb. I know > that it is "good custom" to create indexes after inserting data – but > fixtures in Django

Django, initial data and custom SQL

2009-02-10 Thread Johan Bergström
Hello, I would like to suggest (patch will follow if someone concurs) that custom sql is executed after Django has created indexes. Django is (in my opinion) a bit optimistic regarding index creation, and by looking at pg_stat_* output I see that at least a couple of indexes on busy tables