title: Advice on how to structure my database according to 2 identifiers?
body: <p>I am building a database with Postgres.  </p>
  
  <p>Here is how I want to structure it (conceptually):</p>
  
  <pre><code>my_database = {  
      '1.0.0': {  
          'testA': result1,
          'testB': result2
      },  
      '2.0.0': {
          'testA': result3,
          'testB': result4
      }
  }
  </code></pre>
  
  <p>To explain, I have a program that is versioned (e.g. '1.0.0'), and I have tests that I run on it (e.g. 'testA'), and those tests produce results (e.g. 'result1').</p>
  
  <p>Now, the same version and same test will always produce the same result, so I will want to be checking my database to see if "version 1.0.0 and testB" already has an entry. If so, no need to store any duplicate results.</p>
  
  <p>I am thinking there must be a way to have some sort of many-to-many relationship between tests and versions, where every version has a bunch of tests entered, and each test is perhaps used by many versions.</p>
  
  <p>I am pretty new to database design and am wondering how to set this up to be quick and save space, assuming I have thousands of unique versions, each with thousands of tests (many shared tests across versions).</p>