Opened 7 years ago

Closed 2 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

Description

Adrian and Jacob on stage at DjangoCon.

See also Cal's talk.

Change History (10)

comment:1 Changed 7 years ago by simon

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 Changed 7 years ago by RaceCondition

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 Changed 7 years ago by mtredinnick

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 Changed 6 years ago by alexkoshelev

  • Cc daevaorn@… added

comment:5 Changed 6 years ago by jacob

  • Triage Stage changed from Unreviewed to Someday/Maybe

comment:6 Changed 6 years ago by thejaswi_puthraya

  • Component changed from Uncategorized to Database layer (models, ORM)

comment:7 Changed 4 years ago by lukeplant

  • Severity set to Normal
  • Type set to New feature

comment:8 Changed 3 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:9 Changed 3 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:10 Changed 2 years ago by akaariai

  • Resolution set to wontfix
  • Status changed from new to closed

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