New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use ranking query in custom dimensions archiver #17396
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are also some tests failing that don't look random
@@ -1075,6 +1087,17 @@ public function queryConversionsByDimension($dimensions = array(), $where = fals | |||
$orderBy = false; | |||
$query = $this->generateQuery($select, $from, $where, $groupBy, $orderBy); | |||
|
|||
if (!empty($rankingQuery)) { | |||
$sumColumns = array_keys($availableMetrics); | |||
$rankingQuery->addColumn($sumColumns, 'sum'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diosmosis can we assume that it is always a sum
? or is it maybe also sometimes min, max, etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed this 👍
{ | ||
$configGeneral = Config::getInstance()->General; | ||
$configLimit = $configGeneral['archiving_ranking_query_row_limit']; | ||
$limit = $configLimit == 0 ? 0 : max( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this looks good. Was wondering if the 50K ranking query limit could cause issues since we technically allow 1000 root tables and 1000 entries per subtable by default. I'm assuming this will limit the number of results shown quite a bit but that's kind of also the point of this ranking query?
For the ranking query limit would maybe do something like
$this->rankingQueryLimit = max(configLimit, 10 * $this->maximumRowsInDataTableLevelZero);
just in case someone has a high datatable_archiving_maximum_rows_custom_dimensions
set and so you can still get different results per subtable but I think also not really needed.
I'm not entirely sure what the report groups by though and how the subtables are created so could also just leave as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subtables are urls, so it makes sense 👍
Description:
As title. There might be a random test failure since RankingQuery doesn't apply ordering (probably a good thing).
Review