Everlag / preordain-backend

backend for preorda.in
Other
1 stars 0 forks source link

Historical prices on /api/Prices/Deck #12

Closed Everlag closed 8 years ago

Everlag commented 8 years ago

Currently we only support the latest extrema, it would be a feat to provide a price history of the deck's lowest prices without pinning the cpu.

In theory, postgres' window functions could solve this performantly but testing is needed.

Everlag commented 8 years ago

The issue is that, to provide lowest or highest historical pricing, we need to know for every window the lowest set to query for that card. That means we would need an extrema query for every card for every window.

That means we can't simply do a latest lowest query for the deck and use the sets provided if we want a true representation of a deck's price over time. This is going to be an extremely expensive query.