Skip to content

Instantly share code, notes, and snippets.

@kinglozzer
Created June 13, 2014 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kinglozzer/752c42095c8374866032 to your computer and use it in GitHub Desktop.
Save kinglozzer/752c42095c8374866032 to your computer and use it in GitHub Desktop.
<% cached List(FeatureBox).Max(LastEdited) %>
...
<% end_cached %>
SHOW TABLES LIKE 'FeatureBox' 0.0005ms
SHOW FULL FIELDS IN "FeatureBox" 0.0021ms
SELECT DISTINCT "ClassName" FROM "FeatureBox" 0.0002ms
SELECT DISTINCT MAX("LastEdited") FROM "FeatureBox" 0.0002ms
------------------------------------------------------------------------------------------------------
<% cached CacheKey_FeatureBoxes %>
...
<% end_cached %>
public function CacheKey_FeatureBoxes() {
$query = new SQLQuery("MAX(LastEdited)", "FeatureBox");
return $query->execute()->value();
}
SELECT MAX(LastEdited) FROM FeatureBox 0.0004ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment