Skip to:
Content

bbPress.org

Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#1299 closed defect (bug) (duplicate)

Why are we grabbing data immediately before we update it?

Reported by: Nightgunner5 Owned by:
Priority: low Milestone: 1.1
Component: Back-end Version:
Severity: minor Keywords:
Cc:

Description

Currently, when we update meta, we grab the meta directly from the database, either insert the new data or update the old data (assuming that the old data is not exactly the same as the new data), and then delete the data from cache.

Wouldn't it be more efficient to check if the data is the same as the cache, and if it isn't, update, and if that doesn't change any rows, insert? After that, it makes sense to store the data directly in cache as well.

The current method uses 1-2 queries, plus the extra one needed to retrieve the data after it has been deleted from cache. This method would take anywhere from 0-2 queries, with no missing cache.

Is there some fundamental reason that this method won't work, or am I the first one to think of it?

Change History (4)

#1 @kevinjohngallagher
16 years ago

  • Milestone Future Release → 1.1

#2 @GautamGupta
16 years ago

  • Milestone 1.1 → Future Release
  • Version 1.0.1 → 1.0.2

#3 @mr_pelle
16 years ago

  • Resolution → duplicate
  • Status new → closed

#4 @johnjamesjacoby
15 years ago

  • Milestone Future Release → 1.1
  • Version 1.0.2
Note: See TracTickets for help on using tickets.