title: How do I know if any index is used in a query | PostgreSQL 11?
body: <p>I am little bit confused and need some advice. I use <code>PostgreSQL 11</code> database. I have such pretty simple sql statement:</p>
  
  <pre><code>SELECT DISTINCT "CITY", "AREA", "REGION"
      FROM youtube
  WHERE
      "CITY" IS NOT NULL
  AND
      "AREA" IS NOT NULL
  AND
      "REGION" IS NOT NULL
  </code></pre>
  
  <p><code>youtube</code> table which I use in sql statement has 25 million records. I think for thats why query takes 15-17 seconds to complete. For web project where I use that query it's too long. I'm trying to speed up the request.</p>
  
  <p>I create such index for youtube table:</p>
  
  <pre><code>CREATE INDEX youtube_location_idx ON public.youtube USING btree ("CITY", "AREA", "REGION");
  </code></pre>
  
  <p>After this step I run query again but it takes the same time to complete. It seems like query don't use index. How do I know if any index is used in a query?</p>
  
  <p><strong>EXPLAIN ANALYZE</strong> return:
  <a href="https://i.stack.imgur.com/TUHEf.png" rel="noreferrer"><img src="https://i.stack.imgur.com/TUHEf.png" alt="enter image description here"></a></p>