more work on item table optimisation

This commit is contained in:
redmatrix
2015-06-10 16:59:04 -07:00
parent 2128d5a256
commit ca870dbf31
19 changed files with 123 additions and 82 deletions

View File

@@ -90,15 +90,13 @@ function poller_run($argv, $argc){
// (time travel posts). Restrict to items that have come of age in the last
// couple of days to limit the query to something reasonable.
$r = q("select id from item where ( item_restrict & %d ) > 0 and created <= %s and created > '%s' ",
intval(ITEM_DELAYED_PUBLISH),
$r = q("select id from item where item_delayed = 1 and created <= %s and created > '%s' ",
db_utcnow(),
dbesc(datetime_convert('UTC','UTC','now - 2 days'))
);
if($r) {
foreach($r as $rr) {
$x = q("update item set item_restrict = ( item_restrict & ~%d ) where id = %d",
intval(ITEM_DELAYED_PUBLISH),
$x = q("update item set item_delayed = 0 where id = %d",
intval($rr['id'])
);
if($x) {