This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT data.id | |
FROM (select j1.id as id, | |
j1.title, | |
b1.company, | |
case | |
when active_job.location isnull | |
then :radius | |
when l1.location isnull | |
then :radius | |
else st_distance(l1.location, active_job.location) end as dist, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT data.id | |
FROM (select j1.id as id, | |
j1.title, | |
case | |
when active_job.location isnull | |
then :radius | |
when j1.location isnull | |
then :radius | |
else st_distance(j1.location, active_job.location) end as dist, | |
similarity(j1.title, active_job.title) as close, |
OlderNewer