Skip to content

Instantly share code, notes, and snippets.

@lolobosse
Created February 20, 2021 11:20
Show Gist options
  • Save lolobosse/bef7123018df072260a8795b22ece37c to your computer and use it in GitHub Desktop.
Save lolobosse/bef7123018df072260a8795b22ece37c to your computer and use it in GitHub Desktop.
create materialized view similar_mv as (select j.id,
j.title,
j.source,
j.created_at,
j.updated_at,
j.category_id,
b2bt.company,
lt.location
from job_tb j
join b2b_tb b2bt on j.b2b_id = b2bt.id
join location_tb lt on j.location_id = lt.id
where j.source not in ('Free sources')
and j.finished != true
and lt.addr_zip notnull);
create unique index unique_id on similar_mv (id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment