python - Django hideously slow with 8000 model instances (How to drop PostgreSQL database)? -


i have django installation running on development server. used python manage.py loaddata 8000models.json. super slow. pages won't load. python manage.py flush not return. modeltype.objects.count() not return.

(or maybe return if wait sufficiently long time.)

what's going on here? django unable handle data? or there other issue?

update: observe issue on postgresql not sqlite same amount of data. perhaps need wipe postgresql , reload data.

update 2: how can wipe postgresql , reset? python manage.py reset appname isn't responding.

update 3: how i'm trying wipe postgresql:

#! bin/bash  sudo -u postgres dropdb mydb sudo -u postgres createdb mydb sudo -u postgres psql mydb < ~/my-setup/my-init.sql python ~/path/to/manage.py syncdb 

however, causes following errors:

dropdb: database removal failed: error:  database "mydb" being accessed other users detail:  there 8 other session(s) using database. createdb: database creation failed: error:  database "mydb" exists error:  role "myrole" cannot dropped because objects depend on detail:  owner of table mydb.mytable_mytable # ... more "owner of table", "owner of sequence" statements, etc 

how can close out these other sessions? don't have apache running. i've been using 1 instance of django development server @ time. however, when got unresponsive killed control+z. perhaps caused not release database connection, thereby causing issue? how can around this?

ctrl-z stops process, not kill it. (i assume you're using bash) type jobs in terminal, , should see old processes still running.

once kill jobs accessing postgresql database, should able drop, create, , syncdb expect.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -