On 7 sep, 15:17, Lukáš <[email protected]> wrote:
> Hey,
>
> I am working with Django for a while and now that my "tree" and whole
> DB is filled with data (note: existing database), I was wondering if
> the "one model per table" is really better at this point than "one
> model per select".

I don't have the slightest clue about what "one model per select" is
supposed to mean... But anyway: a Django "model" class IS a
representation of a SQL table / row - so I fail to see how you could
avoid having a one-to-one mapping between models and tables (abstract
models and inheritance issues set aside).


> I have got one table - objtree. This is the place where I have all
> nodes (brands, categories, tags, etc.) stored.  As you can imagine it
> is heavily used in my administration. Today I had to add another
> foreign key for another table, but I have already 2 Foreign keys
> there. The problem is that I use this model for almost everything,

Hard to say without actually reading your code, but it really smells
like a huge design problem.


> BUT
> the foreign keys are used rarely, not to mention the third one that
> would be used this one time. Since each of these tables has 20k+
> (minimum) rows and the foreign keys are used rarely, if it wouldnt be
> better to use "one model class per select" - speed wise.

I still don't understand what this "one model class per select" is
supposed to mean.

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

Reply via email to