igniterealtime / openfire-monitoring-plugin

Adds support for chat archiving and server statistics to Openfire
Apache License 2.0
18 stars 27 forks source link

Improve SQL performance by not forcing sentDate #381

Open guusdk opened 7 months ago

guusdk commented 7 months ago

When a message query is performed without a date range, the existing implementation uses epoch and 'now' to define a range. This effectively covers every message in the archive, and thus should be benign.

Using an explicit data range does require the database to evaluate these values, which can result in sub-optimal performance.

The plugin should be modified to no longer explicitly use epoch and now when no data range is provided.