hasjob icon indicating copy to clipboard operation
hasjob copied to clipboard

Create materialized views per board

Open jace opened this issue 7 years ago • 5 comments

Hasjob's index page currently retrieves all all job posts given the matching criteria, (a) limited by board and (b) by the last 30 days, unless the archive flag is used. We could make this faster using materialised views:

  1. Create a distinct materialized view per board. Whenever a board is created or deleted, the corresponding view is created or deleted. The view has the same query that getposts has, limited to 30 days.

  2. When a post is edited (limited to the columns that are necessary for index views), all corresponding materialized views (based on the boards the post is linked to) are refreshed concurrently.

  3. The getposts function uses the view unless the archive is needed, in which case it queries the main table.

jace avatar Feb 27 '18 17:02 jace

Since we do a fair bit of post-processing client-side, materialized views may be entirely unnecessary if we can do good quality caching after processing.

jace avatar Feb 27 '18 17:02 jace

I want to work on this and #419.

iambibhas avatar Feb 28 '18 06:02 iambibhas

This one is speculative. It may not deliver any performance improvements over client-side caching. Do #419, but only if you can do it within one day. It's not worth spending more time on.

jace avatar Feb 28 '18 06:02 jace

I'm working on #419. Should be done by today.

iambibhas avatar Feb 28 '18 07:02 iambibhas

I predict #419 will take a week to implement properly. Let's move discussion there.

jace avatar Feb 28 '18 07:02 jace