Closed Bug 1611249 Opened 6 years ago Closed 5 years ago

Queries in GLAM dag scan ~80TB per day

Categories

(Data Platform and Tools :: General, defect, P2)

defect
Points:
2

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: benwu, Assigned: benwu)

Details

The queries in the glam dag run daily and scan about 80TB per day which accounts for almost all of the data scanned by airflow dags. It appears that some of the queries are scanning though all of history everyday and aren't taking advantage of partitioning/clustering. It would be worth seeing if we can make better use of clustering or make the queries incremental but this may require rethinking the entire query. Another optimization would be to reduce the number of intermediate tables created if possible but they may be necessary due to query complexity.

If it turns out the data scanned can't be reduced significantly, this dag may be a candidate to run on reserved slots, assuming it would complete in a day.

Marina, is this something you're already looking into?

Flags: needinfo?(msamuel)

I have not yet started to investigate how much we can reduce the cost.

I explained here https://bugzilla.mozilla.org/show_bug.cgi?id=1609772#c4 which queries are clustered/filtered and which aren't. In discussion with Rob, it sounds like this is lower priority relative to fenix + final touches on desktop data for Glam. If someone else has cycles to look at this sooner, that'd be great! If not, I think I may get to it in a few weeks, once we have the fenix timeline figured out.

Flags: needinfo?(msamuel)

Btw. 1 potential low hanging fruit could be to merge clients_scalar_aggregates_v1 + clients_scalar_bucket_counts_v1 and clients_histogram_aggregates_v1 + clients_histogram_bucket_counts_v1 into the same query.

The reason I separated them initially was due to "complex query" errors and timeouts. The queries have all changed a bunch since then so they may be easier to merge now. This is simple enough that I could try it out relatively soon.

Assignee: nobody → bewu
Points: --- → 2
Priority: -- → P2
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.