
Djangonaut diaries, week 3 - Working on an ORM issue
Hi there! The PR from the previous week is currently being reviewed , with some great suggestions from one of the Django fellows, Jacob Walls . In the meantime I picked up one of the issues that were suggested by the navigator for this cohort, Akash , an ORM optimization issue titled "Unnecessary creation of index for ManyToManyField" . In summary, when Django creates the migrations for a many-to-many "through" table, it's creates a database index which may be redundant. If you understood every word on this sentence and the ticket title, maybe this blog post is not for you, you can wait for the next one in which I actually fix the issue. I won't judge you. What? you here still? Great!! Let's dig a bit on what are database indexes, how the most common index for relational databases work (balanced trees, aka b-trees), what are many-to-many (m2m) relations and junction tables (also called through-tables), and finally how "unique" indexes for m2m tables work. Knowing the basics of all that
Continue reading on Dev.to
Opens in a new tab



