# Table data covered entirely by indexes

**URL:** <https://forums.percona.com/t/table-data-covered-entirely-by-indexes/961>\
**Category:** Other MySQL® Questions\
**Created:** [October 14, 2008, 9:18am UTC](https://forums.percona.com/t/table-data-covered-entirely-by-indexes/961 "2008-10-14T09:18:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![neilf](https://avatars.discourse-cdn.com/v4/letter/n/bcef8e/32.png) [@neilf](https://forums.percona.com/u/neilf)\
**Post date:** [October 14, 2008, 9:18am UTC](https://forums.percona.com/t/table-data-covered-entirely-by-indexes/961/1 "2008-10-14T09:18:36Z")

</div>

Hi all.

I have a table that is entirely covered by indexes. That is, every query that I want to perform on the table can be satisfied entirely from indexes, without having to read the table data at all.

This may seem like a bizarre thing to want to do, but does anyone know if it’s possible to store the data in MySQL in _just_ the indexes, without having to store the table data at all, since the table data is never actually accessed?

If this isn’t possible in MySQL, does anyone know of any alternatives? I know that certain column-based stores (for example, C-store) might allow this, by storing my indexes as a set of projections over the data.

Thanks.

Neil.

---

<div class="post-metadata">

**Author:** ![xaprb](https://avatars.discourse-cdn.com/v4/letter/x/49beb7/32.png) [@xaprb](https://forums.percona.com/u/xaprb)\
**Post date:** [December 25, 2009, 11:04am UTC](https://forums.percona.com/t/table-data-covered-entirely-by-indexes/961/2 "2009-12-25T11:04:31Z")

</div>

It’s not possible in MySQL, no.

---

<div class="post-metadata">

**Author:** ![gmouse](https://avatars.discourse-cdn.com/v4/letter/g/b9e5f3/32.png) [@gmouse](https://forums.percona.com/u/gmouse)\
**Post date:** [December 27, 2009, 7:06pm UTC](https://forums.percona.com/t/table-data-covered-entirely-by-indexes/961/3 "2009-12-27T19:06:56Z")

</div>

How about InnoDB with a long primary key? Not smart if you have an additional index though.

---

<div class="post-metadata">

**Author:** ![xaprb](https://avatars.discourse-cdn.com/v4/letter/x/49beb7/32.png) [@xaprb](https://forums.percona.com/u/xaprb)\
**Post date:** [December 27, 2009, 7:17pm UTC](https://forums.percona.com/t/table-data-covered-entirely-by-indexes/961/4 "2009-12-27T19:17:03Z")

</div>

In InnoDB, the primary key IS the table, so unless there is a secondary index, each value is stored only once, and the effect is that you have “only the index” as you wish.
