## Bug description

Currently, decide endpoint takes 10+ seconds on kea.js.org.

This means that for first-time visitors autocapture nor session recording will be turned on for that long - losing valuable information.

When measuring this yesterday via shell ([slack thread](https://posthog.slack.com/archives/C0113360FFV/p1604951621008400)), the culprit was feature flags cohort checking. In this case, the cohort user was checked against was defined against the following action:

![Screenshot from 2020-11-10 11-41-32](https://user-images.githubusercontent.com/148820/98657215-49582e80-234a-11eb-9669-37d55e0d23bd.png)

Which currently looks through events of the data for that team.

## Expected behavior

Decide endpoint should use cached/materialized cohort ownership rather than calculating it on the fly.

## How to reproduce

1. Create an action with some selector
2. Create a cohort for has done action at any point
3. Create a feature flag using the cohort.
4. Measure /decide endpoint latency

## Environment

Cloud 

## Additional context

cc @EDsCODE who made it not time out by https://github.com/PostHog/posthog/pull/2299

#### *Thank you* for your bug report – we love squashing them!
posthog/test/test_cohort_model.py
from posthog.api.test.base import BaseTest
from posthog.models import Action, ActionStep, Cohort, Element, Event, Person, Team
class TestCohort(BaseTest):
    def test_get_distinct_ids_from_cohort(self):
        person1 = Person.objects.create(distinct_ids=["person_1"], team=self.team)
        event1 = Event.objects.create(event="user signed up", team=self.team, distinct_id="person_1")
        action = Action.objects.create(team=self.team)
        ActionStep.objects.create(action=action, event="user signed up")
        action.calculate_events()
        person2 = Person.objects.create(distinct_ids=["person_2"], team=self.team, properties={"$os": "Chrome"})
        person3 = Person.objects.create(distinct_ids=["person_3"], team=self.team)
        person4 = Person.objects.create(distinct_ids=["person_4"], team=self.team)
        cohort = Cohort.objects.create(team=self.team, groups=[{"action_id": action.pk, "days": 7}])
        cohort.calculate_people()
        with self.assertNumQueries(1):
            self.assertEqual([p for p in cohort.people.all()], [person1])
        cohort = Cohort.objects.create(
            team=self.team, groups=[{"properties": [{"key": "$os", "value": "Chrome", "type": "person"}]}],
        )
        cohort.calculate_people()
        self.assertEqual([p for p in cohort.people.all()], [person2])
        cohort = Cohort.objects.create(team=self.team, groups=[{"properties": {"$os__icontains": "Chr"}}])
        cohort.calculate_people()
        self.assertEqual([p for p in cohort.people.all()], [person2])
        cohort = Cohort.objects.create(
            team=self.team, groups=[{"action_id": action.pk}, {"properties": {"$os": "Chrome"}}],
        )
        cohort.calculate_people()
        self.assertCountEqual([p for p in cohort.people.all()], [person1, person2])