open-contracting / kingfisher-summarize

Creates SQL tables that summarize the OCDS data in collections from Kingfisher Process
https://kingfisher-summarize.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
3 stars 8 forks source link

sql: Replace similar tables with templated queries #208

Closed Bjwebb closed 3 years ago

Bjwebb commented 3 years ago

https://github.com/open-contracting/kingfisher-summarize/issues/139

Bjwebb commented 3 years ago

@jpmckinney This is only some of the suggested tables, but I thought it might be useful for you to review the approach before I proceed with the rest.

jpmckinney commented 3 years ago

Also, calling EXECUTE three times in one file means that this file will need to wait for tender, award, and contract dependencies to complete, which will make Summarize a little slower. Can we instead have the CREATE TABLE query in a function, and call the function from separate files, so that Summarize can schedule them more aggressively?