Skip to content
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

Add more debug info to archiving queries #15196

Merged
merged 3 commits into from Dec 10, 2019
Merged

Add more debug info to archiving queries #15196

merged 3 commits into from Dec 10, 2019

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Nov 25, 2019

Otherwise it is hard to find out for what period etc the query was. Ideally we would add segmentId instead of segmentHash but would need to refactor some code from segmentQueryDecorator to the segmentClass (the method that finds the segmentId for a segment)...

example:

SELECT /* 2019-11-25,2019-11-26 sites 1 segmenthash 6fb490cfce17323e01f4d11d61ea9679 */ /* Core */
				count(distinct log_visit.idvisitor) AS `1`, 
			count(*) AS `2`, 
			sum(log_visit.visit_total_actions) AS `3`, 
			max(log_visit.visit_total_actions) AS `4`, 
			sum(log_visit.visit_total_time) AS `5`, 
			sum(case log_visit.visit_total_actions when 1 then 1 when 0 then 1 else 0 end) AS `6`, 
			sum(case log_visit.visit_goal_converted when 1 then 1 else 0 end) AS `7`, 
			count(distinct log_visit.user_id) AS `39`
			FROM
				piwik_logtmpsegmentde86627ef24972fd077a35a9eb0dc563 AS logtmpsegmentde86627ef24972fd077a35a9eb0dc563 INNER JOIN piwik_log_visit AS log_visit ON log_visit.idvisit = logtmpsegmentde86627ef24972fd077a35a9eb0dc563.idvisit 

Otherwise it is hard to find out  for what  period etc the query was. Ideally we would also make the segmentDecorator work somehow but not having enough time right now. As we otherwise can't know which segment was applied because we can only see the
@tsteur tsteur added the Needs Review PRs that need a code review label Nov 25, 2019
@tsteur tsteur added this to the 3.13.0 milestone Nov 25, 2019
@mattab mattab modified the milestones: 3.13.0, 3.13.1 Nov 27, 2019
@diosmosis
Copy link
Member

I was looking at the code for the SegmentQueryDetector code and it seems like it should be called no matter what (since Segment::getSelectQuery() is called which calls getSelectQueryString() on the LogQueryBuilder. Is it not doing that currently?

@tsteur
Copy link
Member Author

tsteur commented Nov 27, 2019

I think the segmentQueryDecorator maybe gets only called when the create temporary table select segmentquery is being executed?

@diosmosis
Copy link
Member

I see, there's an if I didn't notice...

@diosmosis diosmosis merged commit d150c5e into 3.x-dev Dec 10, 2019
@diosmosis diosmosis deleted the debuginfosql branch December 10, 2019 23:40
jonasgrilleres pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 22, 2020
* Add more debug info to archiving queries

Otherwise it is hard to find out  for what  period etc the query was. Ideally we would also make the segmentDecorator work somehow but not having enough time right now. As we otherwise can't know which segment was applied because we can only see the

* Update LogAggregator.php

* add segment hash...
jbuget pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 26, 2020
* Add more debug info to archiving queries

Otherwise it is hard to find out  for what  period etc the query was. Ideally we would also make the segmentDecorator work somehow but not having enough time right now. As we otherwise can't know which segment was applied because we can only see the

* Update LogAggregator.php

* add segment hash...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants