simonsobs / sisock

Sisock ('saɪsɒk): streaming of Simons Obs. data over websockets for quicklook
Other
2 stars 0 forks source link

Improve SQL Query Efficiency #36

Closed BrianJKoopman closed 5 years ago

BrianJKoopman commented 5 years ago

This implements a more efficient SQL query to build the fields list that the g3-reader data server returns. It also adds a table to the database with the built fields list. While probably the field list could be simply generated on each get_fields() call, in my testing I'm finding it a factor of 10 faster to use the description table as I first implemented (~0.0056 seconds to query the description table only vs ~0.058 seconds to build the list from a fresh query on both the fields and feeds table). Since get_fields() is called many times by Grafana I'm going to leave the additional table in to eek out all the speed improvements we can get.

resolves #35