0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 08:40:03 +01:00
posthog/ee
Karl-Aksel Puulmann d9bc06b7dd
Speed up lifecycle query (#8021)
* refactor(lifecycle): simplify clickhouse sql logic

This updates the SQL to be comprised of two queries, one for getting
new, returning, and resurrecting periods of activity, one for getting
dormant periods right after periods of activity.

Refers to https://github.com/PostHog/posthog/issues/7382

* refactor(lifecyle): use `ClickhouseEventQuery` to build event query

* format

* Use bounded_person_activity_by_period for both sides of dormant join

* refactor(lifecycle): reduce pdi2 join by one

This means we're now under the current query memory limit for orgs with
around 20m distinct_ids. It does remove some readability though :(

* update snapshot

* Add further comments to query

* Add further comments to query

* Add further comments to query

* Remove dead variables

* Refactor person_query overriding

* Lifecycle refactoring continued

* Update lifecycle tests (except people ones)

* Make lifecycle people endpoint happy

* Remove django lifecycle tests

* Add some edge case tests

* Add missing type

Co-authored-by: Harry Waye <harry@posthog.com>
2022-01-13 16:31:09 +02:00
..
api
benchmarks Benchmarks: trends breakdown and lifecycle with filtering (#8018) 2022-01-13 11:53:00 +02:00
bin
certs
clickhouse Speed up lifecycle query (#8021) 2022-01-13 16:31:09 +02:00
idl
kafka_client
management/commands auto complete non required async migrations at migrate step (#7942) 2022-01-10 15:34:07 -03:00
migrations
models
tasks [cohort] insight cohorts (#7569) 2022-01-06 10:38:29 -05:00
__init__.py
apps.py
conftest.py
docker-compose.ch.arm64.yml
docker-compose.ch.test.yml
docker-compose.ch.yml
LICENSE
pytest.ini
settings.py
urls.py