karpenoktem / kninfra

Digital infrastructure of Karpe Noktem
http://karpenoktem.nl/
10 stars 14 forks source link

kn.fotos.entities: hopefully faster get_random_foto_for query #531

Closed yorickvP closed 2 years ago

yorickvP commented 3 years ago

This query was taking most of the time loading the /fotos/ page for logged in members. Mongo 3.2 adds an aggregation operation that can get a random element from a query more easily. If this doesn't solve it, we should look at some caching.