Skip to:

Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#1299 closed defect (bug) (duplicate)

Why are we grabbing data immediately before we update it?

Reported by: nightgunner5's profile Nightgunner5 Owned by:
Milestone: 1.1 Priority: low
Severity: minor Version:
Component: Back-end Keywords:


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
14 years ago

  • Milestone changed from Future Release to 1.1

#2 @GautamGupta
14 years ago

  • Milestone changed from 1.1 to Future Release
  • Version changed from 1.0.1 to 1.0.2

#3 @mr_pelle
14 years ago

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

#4 @johnjamesjacoby
13 years ago

  • Milestone changed from Future Release to 1.1
  • Version 1.0.2 deleted
Note: See TracTickets for help on using tickets.