# Optimization by storing database table in memory?

**URL:** <https://forum.elixirforum.com/t/optimization-by-storing-database-table-in-memory/14572>\
**Category:** Questions\
**Tags:** cache, memory\
**Created:** [June 6, 2018, 3:22pm UTC](https://forum.elixirforum.com/t/optimization-by-storing-database-table-in-memory/14572 "2018-06-06T15:22:23Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![michalmuskala](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/michalmuskala/32/20288_2.png) [@michalmuskala](https://forum.elixirforum.com/u/michalmuskala)\
**Post date:** [June 6, 2018, 6:42pm UTC](https://forum.elixirforum.com/t/optimization-by-storing-database-table-in-memory/14572/8 "2018-06-06T18:42:44Z")

</div>

> [@OvermindDL1](#):
>
> This performs a linear search internally though.

If the key is part of a match spec, it doesn’t. In `ordered_set` tables just a prefix of a key is enough not to trigger a full table scan.

---

_[View the full topic](https://forum.elixirforum.com/t/optimization-by-storing-database-table-in-memory/14572)._
