Open qjhart opened 4 years ago
@qjhart 03_functions.sql has issues, won't load for me locally.
@qjhart still failing
postgres=# create materialized view datafest.page_price_p as
postgres-# with a as (
postgres(# select t.page_ark
postgres(# from rtesseract.page t
postgres(# join datafest.page p on (t.page_ark=p.page_ark)
postgres(# ),
postgres-# b as (
postgres(# select page_ark,count(*)
postgres(# from wine_search.price
postgres(# join a using (page_ark)
postgres(# group by page_ark
postgres(# ),
postgres-# c as (
postgres(# select sum(count)
postgres(# from b
postgres(# ),
postgres-# d as (
postgres(# select
postgres(# page_ark,
postgres(# case when (b is null) then 1000.0/c.sum else b.count*1000.0/c.sum end as prob
postgres(# from a
postgres(# left join b using (page_ark),c
postgres(# )
postgres-# select
postgres-# page_ark,
postgres-# prob,
postgres-# sum(prob) OVER (order by page_ark RANGE UNBOUNDED PRECEDING) as cum
postgres-# from d;
ERROR: relation "rtesseract.page" does not exist
LINE 4: from rtesseract.page t
^
@qjhart ready for deployment
The current database has a datafest.next_page function. Need up to update the app to use this. Called like: