title: DynamoDB: Fetch all items that match one of possible keys
body: <p>Say I have the following table —</p>
  <pre><code>itemA | itemB | relationScore | type
  ----------------------------------------
  &quot;s&quot;   |   &quot;a&quot; |      1.0      |  &quot;foo&quot;
  &quot;s&quot;   |   &quot;b&quot; |      1.0      |  &quot;bar&quot;
  ...
   
  </code></pre>
  <p>Here, <code>itemA</code> + <code>itemB</code> is unique per row, and I've made them the hash key and range key respectively.</p>
  <p>My query, however, needs me to fetch all items such that —</p>
  <ol>
  <li><code>itemA</code> is equal to one of (A,B,C,D ....) (i.e. a list of options)</li>
  <li><code>type</code> is equal to &quot;foo&quot;</li>
  </ol>
  <p>How do I build indexes to be able to do this without using scans / requiring multiple queries?</p>
  <p><strong>Note</strong>: I don't want to query on just <code>type</code> and filter it later in memory because <code>type</code> has very low cardinality, and would end up returning a humongous list back.</p>