# Do we need to create Indexes for all bins that i need to search on?

**URL:** https://discuss.aerospike.com/t/do-we-need-to-create-indexes-for-all-bins-that-i-need-to-search-on/989
**Category:** General Discussion
**Created:** [February 26, 2015, 5:51am UTC](https://discuss.aerospike.com/t/do-we-need-to-create-indexes-for-all-bins-that-i-need-to-search-on/989 "2015-02-26T05:51:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![amitvengs](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@amitvengs](https://discuss.aerospike.com/u/amitvengs)
#### Post date: [February 26, 2015, 5:51am UTC](https://discuss.aerospike.com/t/do-we-need-to-create-indexes-for-all-bins-that-i-need-to-search-on/989/1 "2015-02-26T05:51:25Z")

</div>

Suppose there are 10 bins, i need to search these bins.

1. Do i need to create Indexes on all bins that need to be searched upon?

---

<div class="post-metadata">

### Author: ![raj](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@raj](https://discuss.aerospike.com/u/raj)
#### Post date: [February 26, 2015, 10:45am UTC](https://discuss.aerospike.com/t/do-we-need-to-create-indexes-for-all-bins-that-i-need-to-search-on/989/2 "2015-02-26T10:45:10Z")

</div>

If you need to look up Aerospike using any of these 10 bins values, then you need to create secondary index on all of them.

Other option would be to do scan (analogous to table scan in RDBMS) but that would read entire database which is kind of lot of work and slow…

What alternative do you have in your mind ??

– R

---

<div class="post-metadata">

### Author: ![amitvengs](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@amitvengs](https://discuss.aerospike.com/u/amitvengs)
#### Post date: [February 26, 2015, 1:05pm UTC](https://discuss.aerospike.com/t/do-we-need-to-create-indexes-for-all-bins-that-i-need-to-search-on/989/3 "2015-02-26T13:05:15Z")

</div>

in that case, secondary Index would be the option then…
