title: Data filtration from JSONB | Postgres
body: <p>I have a question regarding querying data from jsob fields.</p>
  <p>I have a following table (simplified):</p>
  <pre class="lang-sql prettyprint-override"><code>create table mytable
  (
     
      headers          jsonb                    not null,
      
  );
  </code></pre>
  <p><code>headers</code> column stores HTTP headers, one of them is &quot;<code>PATH_INFO</code>&quot; ( always present in data) and it basically stores related paths of requests.</p>
  <p>Example <code>&quot;/api/users&quot;</code></p>
  <p>What is the best way to get all unique <code>&quot;PATH_INFO&quot;</code> entries from <code>headers</code> data keeping in mind that path with <code>/</code> at the end and without <code>/</code> at the end should be treated as same paths?</p>
  <p>Example  - <code>&quot;/api/users&quot; == &quot;/api/users/&quot;</code></p>
  <p>LIKE and ILIKE seem to slow…</p>
  <p>Thank you.</p>
  <p>Postgres version - 11</p>