Django VS the AMD Sempron

Django, Errors, Open Source, PostgreSQL, Web Comments Off

Today’s screenshot is brought to you by the Django Admin interface:

CPU at 100%

For those of you who don’t recognize this, it’s the GNOME System Monitor applet. The dark blue basically represents CPU usage for Django (more accurately - caused by Django). The model validates [1] and the tables/Models are shown in the front page of the Admins interface. Most of the Models are represented well and work as one would expect. However, there is one table/Model that doesn’t work as expected. It works OK when you go to add an additional record [2], but when going to view items before changing them [3], it causes the CPU to spike and three minutes later I have my results. Before I edited the table/Model to remove one of the ForeignKeys, I would get a PostgreSQL error because Django passed it a SELECT statement with *over* 1664 entries [4]! Well, it seems that by editing the table I was able to keep the entries under the 1664 limit and PostgreSQL would process the SELECT, but it takes forever to finish it.

I guess that technically, the CPU is being eaten up by PostgreSQL, but that’s not really the point. The point is that Django really doesn’t have any business sending it a SELECT statement with some 2000+ entries in it (especially for such a simple, simple request.) OK, so maybe it has a bug, limitation or whatever, I’m cool with that - it happens. The frustrating part is that I can’t confirm that this is a known problem or find the answer. The answer I’m looking for should be simple, but I have not been able to find it. IRC and #django was a bust and the mailing list yields nothing yet.

I was pretty enthusiastic about Django, but maybe it’s to soon. It’s a cool project and I wish them luck. I’m just wondering if all the time spent so far porting one of my apps to the Django framework was time wasted or not.

1) -
./manage.py runserver
Validating models…
0 errors found.

2) http://localhost:8000/admin/App/Model/add/

3) http://localhost:8000/admin/App/Model/

4) -
Request URL: http://localhost:8000/admin/core/stagedorder/
Exception Type: ProgrammingError
Exception Value: ERROR: target lists can have at most 1664 entries SELECT

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Login