Query performance issue using C# API compared to UI
lybax opened this issue · 3 comments
Hi,
I'm using SeqConnection.Events.InSignalAsync method with
- a shared signal defined from the UI (as unsavedSignal parameter)
- a search expression (MessageTypeId = 837)
This signal combined with the search expression starts to return first results (from the previous day) in about 10 seconds from the UI after having scanned about 4460961 events.
When I use InSignalAsync method with the same filters (in a loop using ResultSetPart.Statistics.LastReadEventId for incremental search), I reach 4848393 scanned events in about a minute, but the LastReadEventTimestamp is still today (5:00 AM)...
What's the difference between the C# API InSignalAsync method and the UI query engine ?
How can I reach the same performances from my app ?
Thank you for your help.
Best regards,
Nicolas
Hi!
When you select a saved signal in the UI, it will hit the underlying index associated with the signal, which would account for the faster execution time.
From the API, instead of using unsavedSignal
, can you pass through the saved signal's id in signal
?
This looks like:
connection.Events.InSignalAsync(signal: SignalExpressionPart.Signal(signalId))
Does this help?
Best regards,
Nick
This works perfectly.
Thank you Nick !
Best regards,
Nicolas
Thanks for the follow-up! 👍