fleetdm / fleet

Open-source platform for IT, security, and infrastructure teams. (Linux, macOS, Chrome, Windows, cloud, data center)
https://fleetdm.com
Other
3k stars 416 forks source link

Prepare query on distributed write #4515

Open zwinnerman-fleetdm opened 2 years ago

zwinnerman-fleetdm commented 2 years ago

Similar to #4064, the query SELECT * FROM distributed_query_campaigns WHERE id = ? is prepared and run once per endpoint per live query. This takes ~1-1.5ms per host per live query since the statement is not prepared ahead of time.

Goal:

To have the query mentioned above use the same pattern as in #4064 so that it is prepared beforehand instead of just in time.

xpkoala commented 2 years ago

@zwinnerman-fleetdm I may be incorrect, but this looks more like an improvement instead of a bug. If this is a bug we can change it back over.

Could you please attach a goal to the ticket so it can be tracked?

zwinnerman-fleetdm commented 2 years ago

Should be updated @xpkoala