Skip to content

Commit

Permalink
Merge pull request #2 from Wikia/REL1_37-optimize-actor-queries
Browse files Browse the repository at this point in the history
Rel1 37 optimize actor queries
  • Loading branch information
Michal-Chatlas1221 authored Apr 26, 2022
2 parents 1738633 + 8a99830 commit ed3963a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions includes/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ private function _firstrevisionsince( $option ) {
$this->addWhere(
[
$this->tableNames['page'] . '.page_id = rev.revactor_page',
'rev.revactor_timestamp = (SELECT MIN(rev_aux_snc.rev_timestamp) FROM ' . $this->tableNames['revision'] . ' AS rev_aux_snc WHERE rev_aux_snc.rev_page=rev.rev_page AND rev_aux_snc.rev_timestamp >= ' . $this->convertTimestamp( $option ) . ')'
'rev.revactor_timestamp = (SELECT MIN(rev_aux_snc.rev_timestamp) FROM ' . $this->tableNames['revision'] . ' AS rev_aux_snc WHERE rev_aux_snc.rev_page=rev.revactor_page AND rev_aux_snc.rev_timestamp >= ' . $this->convertTimestamp( $option ) . ')'
]
);
}
Expand Down Expand Up @@ -1249,7 +1249,7 @@ private function _lastrevisionbefore( $option ) {
$this->addWhere(
[
$this->tableNames['page'] . '.page_id = rev.revactor_page',
'rev.revactor_timestamp = (SELECT MAX(rev_aux_bef.rev_timestamp) FROM ' . $this->tableNames['revision'] . ' AS rev_aux_bef WHERE rev_aux_bef.rev_page=rev.rev_page AND rev_aux_bef.rev_timestamp < ' . $this->convertTimestamp( $option ) . ')'
'rev.revactor_timestamp = (SELECT MAX(rev_aux_bef.rev_timestamp) FROM ' . $this->tableNames['revision'] . ' AS rev_aux_bef WHERE rev_aux_bef.rev_page=rev.revactor_page AND rev_aux_bef.rev_timestamp < ' . $this->convertTimestamp( $option ) . ')'
]
);
}
Expand Down Expand Up @@ -1545,7 +1545,7 @@ private function _namespace( $option ) {
} else {
$this->addWhere(
[
"{$this->tableNames['page']}.page_namespace" => $option
"{$this->tableNames['page']}.page_namespace" => $option ?: 0
]
);
}
Expand Down

0 comments on commit ed3963a

Please sign in to comment.