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

1936 retention graph #2578

Merged
merged 47 commits into from
Dec 1, 2020
Merged

1936 retention graph #2578

merged 47 commits into from
Dec 1, 2020

Conversation

EDsCODE
Copy link
Member

@EDsCODE EDsCODE commented Nov 30, 2020

Changes

Please describe.

  • all the additions of first time retention and multiple events has made the query incredibly slow especially when processing actions
    If this affects the frontend, include screenshots.

Checklist

  • All querysets/queries filter by Organization, by Team, and by User
  • Django backend tests
  • Jest frontend tests
  • Cypress end-to-end tests

@timgl timgl temporarily deployed to posthog-1936-retention--3gc048 November 30, 2020 21:47 Inactive
@EDsCODE
Copy link
Member Author

EDsCODE commented Dec 1, 2020

Note describing what's happening:
The first time retention calculation requires a subquery to look for the earliest time unique users performed an even (with specified properties) across all time. The query is proving to be heavy and it's compounded by complex actions that try to match on many conditions

…o 1936-retention-graph

* '1936-retention-graph' of github.com:PostHog/posthog:
  remove unneded comment and import
@EDsCODE EDsCODE temporarily deployed to posthog-1936-retention--3gc048 December 1, 2020 14:56 Inactive
@EDsCODE
Copy link
Member Author

EDsCODE commented Dec 1, 2020

I split the query so it queries for initial period events separately from the rest of the retention. This will reduce overhead inside the large query where it would have to union a subquery

@EDsCODE EDsCODE marked this pull request as ready for review December 1, 2020 15:04
@EDsCODE EDsCODE merged commit 98932d0 into master Dec 1, 2020
@EDsCODE EDsCODE deleted the 1936-retention-graph branch December 1, 2020 15:15
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.

2 participants