:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
perf(flags): use LEFT JOIN for team flag config lookup (#73645)
Phil Haack97f02e5f9b52
diff --git a/nodejs/src/common/utils/team-manager.ts b/nodejs/src/common/utils/team-manager.tsindex 160e45dd6bc6..e95583eecf34 100644--- a/nodejs/src/common/utils/team-manager.ts+++ b/nodejs/src/common/utils/team-manager.ts@@ -134,13 +134,11 @@ export class TeamManager {t.logs_settings,t.extra_settings,extract('epoch' from t.drop_events_older_than) as drop_events_older_than_seconds,- COALESCE(- (SELECT minimal_flag_called_events FROM feature_flags_teamfeatureflagsconfig WHERE team_id = t.id),- false- ) AS minimal_flag_called_events,+ COALESCE(cfg.minimal_flag_called_events, false) AS minimal_flag_called_events,o.available_product_featuresFROM posthog_team tJOIN posthog_organization o ON o.id = t.organization_id+ LEFT JOIN feature_flags_teamfeatureflagsconfig cfg ON cfg.team_id = t.idWHERE t.id = ANY($1) OR t.api_token = ANY($2)`,[teamIds, tokens],