[Fixed]-If I use django, I should not care about any MySQl optimization like indexation?

2đź‘Ť

âś…

Answer: you should care, but not at first (usually).

Django doesn’t take care of everything for you, only the basic/initial indexes (if you use migration tool and not creating the tables manually).
The index is related to the actual data that will be stored in the table, not only the table structure, somthing that is not known by django during the tables creation. Some indexs you get for “free”, by creating unique constraints etc. (assuming you use tools like south that does that for you) but not real optimizations – this you’ll have to do on your own when the time comes.

Some optimizations can be done by “telling” Django which indexes should be added, but you will have to specify it yourself.

👤Lin

0đź‘Ť

No, Django only creates indices required by the database system, for example when creating foreign keys. You will have to optimise your database yourself, more on that in the documentation.

👤rafalmp

0đź‘Ť

👤souldeux

-1đź‘Ť

Yes, you are right…with Django you can generate your database from your model (classes), you have to use specifics inheritance and types but it’s pretty easy to handle and of course it’s as optimal as could be needed.

👤AlexanderFC

Leave a comment