Opened 16 years ago

Closed 11 years ago

#8946 closed New feature (wontfix)

Denormalisation built in to the ORM

Reported by: simon Owned by: nobody
Component: Database layer (models, ORM) Version: 1.0
Severity: Normal Keywords: djangocon
Cc: daevaorn@… Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Adrian and Jacob on stage at DjangoCon.

See also Cal's talk.

Change History (10)

comment:1 by simon, 16 years ago

Some common denormalisations:

  • A field maintains the count of a set of related fields, e.g. a forum Thread storing the number of Replies belonging to that thread.
  • A field is calculated from another field using an expensive operation. For example, rendering HTML using markdown.
  • A field from a joined table is frequently used for lookups, so is copied to the parent table to avoid having to make a join.

Please add more!

comment:2 by Erik Allik, 16 years ago

In addition to the count of a set of related fields, also max/min/avg. For example one would want to store the creation date of the newest comment of an article because articles are often sorted by activity.

comment:3 by Malcolm Tredinnick, 16 years ago

Contrary to Simon's request, let's please keep design discussion on the mailing list, as per normal. That way everybody can participate and there's a record. Tickets are terrible for design discussions. Yes, it might have to wait for a lull in other active conversations. Thankfully, we don't have to solve every problem in the next week or even the next month.

comment:4 by Alexander Koshelev, 15 years ago

Cc: daevaorn@… added

comment:5 by Jacob, 15 years ago

Triage Stage: UnreviewedSomeday/Maybe

comment:6 by Thejaswi Puthraya, 15 years ago

Component: UncategorizedDatabase layer (models, ORM)

comment:7 by Luke Plant, 13 years ago

Severity: Normal
Type: New feature

comment:8 by Aymeric Augustin, 12 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:9 by Aymeric Augustin, 12 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:10 by Anssi Kääriäinen, 11 years ago

Resolution: wontfix
Status: newclosed

I'm going to close this. Reasons:

  • It seems this could be implemented perfectly well in 3rd party apps (with maybe some added hooks in core)
  • This seems really, really hard to do in cross-db compliant way, supporting all the different ORM queries we have (update() etc), and with concurrency tackled. Raw SQL would get past us in any case
  • There are different use cases which would benefit from different approaches, again pointing to 3rd party apps
  • No action in 4 years
  • This ticket doesn't have much useful information

If somebody has plans do something about this, please reopen.

Note: See TracTickets for help on using tickets.
Back to Top