gittip/www.gittip.com — pull request #1155 by whit537 (2013-07-17 00:36:29+00:00)
Title: Add an intermediate table for homepage queries

This addresses #659 by adding three new tables:

- homepage_new_participants
- homepage_top_givers
- homepage_top_receivers

These are created as empty tables in schema.sql, and then in
configure-aspen.py, a daemon thread is started on server startup that
periodically runs the heavy queries needed to populate those tables. It
does so atomically in such a way that reads from the table are not
blocked while the table is being written to. The periodicity is
configurable with the UPDATE_HOMEPAGE_EVERY envvar (int seconds). The
queries in index.html are updated to use the new tables.