View Source Plausible.Stats.QueryOptimizer (Plausible v0.0.1)

Methods to manipulate Query for business logic reasons before building an ecto query.

Summary

Functions

This module manipulates an existing query, updating it according to business logic.

Splits a query into event and sessions subcomponents as not all metrics can be queried from a single table.

Functions

This module manipulates an existing query, updating it according to business logic.

For example, it:

  1. Figures out what the right granularity to group by time is
  2. Adds a missing order_by clause to a query
  3. Updating "time" dimension in order_by to the right granularity

Splits a query into event and sessions subcomponents as not all metrics can be queried from a single table.

event:page dimension is treated in a special way, doing a breakdown of visit:entry_page for sessions.