# Database indexing and keys

**URL:** <https://forum.inductiveautomation.com/t/database-indexing-and-keys/855>\
**Category:** Archived Topics\
**Created:** [October 27, 2008, 5:38pm UTC](https://forum.inductiveautomation.com/t/database-indexing-and-keys/855 "2008-10-27T17:38:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrtweaver](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mrtweaver](https://forum.inductiveautomation.com/u/mrtweaver)\
**Post date:** [October 27, 2008, 5:38pm UTC](https://forum.inductiveautomation.com/t/database-indexing-and-keys/855/1 "2008-10-27T17:38:14Z")

</div>

I was wondering, when using the Inductive Automation software and running queries on Microsoft SQL I know that you can setup indexes and such in SQL. But a DB programmer asked me if in your software you have to call the index in order to use it.

Example:

select runtime from prodtrak where machine = 1 and shift = 1

Now if in the Studio Manager for SQL you have an index set up that indexes machine and shift. Do you have to call the index in this query using the INDEX BY statement or does your software automatically know to use the index if available?

Thanks and have a great day.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [October 27, 2008, 6:00pm UTC](https://forum.inductiveautomation.com/t/database-indexing-and-keys/855/2 "2008-10-27T18:00:15Z")

</div>

I’ve never heard of an “INDEX BY” clause. Our software is not aware of the presence of any indexes, and certainly doesn’t specify to use them or not. Using indexes to optimize query performance is purely in the database’s domain.
