Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Limit number of entries to prefill from cache #1792

Merged
merged 1 commit into from
Jan 10, 2017

Conversation

erikjohnston
Copy link
Member

Some tables, like device_inbox, take a long time to query at startup for
the stream change cache prefills. This is likely because they are slower
growing streams and so are more fragmented on disk. For now, lets pull
fewer entries out to make startup quicker.

In future, we should add a better index to make it even faster.

Some tables, like device_inbox, take a long time to query at startup for
the stream change cache prefills. This is likely because they are slower
growing streams and so are more fragmented on disk. For now, lets pull
fewer entries out to make startup quicker.

In future, we should add a better index to make it even faster.
@NegativeMjark
Copy link
Contributor

LGTM codewise but I don't think it'll actually fix the perf for device_inbox prefill since the query is doing an index scan rather than a backwards index scan. See query plans #1768.

@erikjohnston
Copy link
Member Author

... but I don't think it'll actually fix the perf for device_inbox prefill...

It does, I tested it.

... since the query is doing an index scan rather than a backwards index scan

Going forwards or backwards only matters if you're counting. When using the stream_id > ? predicate going forwards or backwards is equivalent.

@NegativeMjark
Copy link
Contributor

NegativeMjark commented Jan 10, 2017

K, makes sense. (would be really awesome if we could tune this on a worker by worker basis, but I digress).

@erikjohnston erikjohnston merged commit d524bc9 into develop Jan 10, 2017
@erikjohnston erikjohnston deleted the erikj/limit_cache_prefill_device branch March 29, 2017 10:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants