Skip to content

Run broken down analyses with a single SQL query - #5186

Merged
EDsCODE merged 9 commits into
masterfrom
single-query-breakdown
Jul 21, 2021
Merged

EDsCODE merged 9 commits into
masterfrom
single-query-breakdown

Conversation

@Twixes

@Twixes Twixes commented Jul 17, 2021 •

Copy link
Copy Markdown
Contributor

Changes

Production-ready #5072:
Currently our ClickHouse analyses require an additional SQL query when using breakdown – for obtaining values to break down by. This impacts speed and therefore user experience, because an additional query round trip before the proper query takes time. We can do away with this using common table expressions though – this way the same breakdown values query is ran before the proper analysis one all in the same query string.

Checklist

  • All querysets/queries filter by Organization, by Team, and by User
  • Django backend tests

@Twixes
Twixes requested review from EDsCODE and neilkakkar July 17, 2021 00:39
@timgl
timgl temporarily deployed to posthog-pr-5186 July 17, 2021 00:40 Inactive
@Twixes
Twixes temporarily deployed to posthog-pr-5186 July 17, 2021 00:55 Inactive
@Twixes
Twixes temporarily deployed to posthog-pr-5186 July 17, 2021 01:21 Inactive
@EDsCODE
EDsCODE temporarily deployed to posthog-pr-5186 July 20, 2021 15:34 Inactive
@EDsCODE
EDsCODE temporarily deployed to posthog-pr-5186 July 20, 2021 16:05 Inactive
@EDsCODE
EDsCODE temporarily deployed to posthog-pr-5186 July 20, 2021 17:33 Inactive
@EDsCODE EDsCODE mentioned this pull request Jul 20, 2021
6 tasks
@EDsCODE
EDsCODE temporarily deployed to posthog-pr-5186 July 20, 2021 23:38 Inactive
@EDsCODE
EDsCODE temporarily deployed to posthog-pr-5186 July 21, 2021 02:16 Inactive
@EDsCODE
EDsCODE merged commit 3e5b073 into master Jul 21, 2021
@EDsCODE
EDsCODE deleted the single-query-breakdown branch July 21, 2021 18:00
EDsCODE added a commit that referenced this pull request Jul 21, 2021
EDsCODE added a commit that referenced this pull request Jul 21, 2021
@EDsCODE EDsCODE mentioned this pull request Jul 22, 2021
6 tasks
@EDsCODE

EDsCODE commented Aug 2, 2021

Copy link
Copy Markdown
Collaborator

Note: This isn't plausible atm because CTEs don't work as expected with distributed tables yet

This branch was previously deployed

1 inactive deployment
posthog-pr-5186 — 74fe7d19 Deployed Jul 21, 2021 by EDsCODE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants