datalust / seq-api

HTTP API client for Seq
https://datalust.co/seq
Apache License 2.0
77 stars 21 forks source link

Query performance issue using C# API compared to UI #62

Closed lybax closed 4 years ago

lybax commented 4 years ago

Hi,

I'm using SeqConnection.Events.InSignalAsync method with

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

nblumhardt commented 4 years ago

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

lybax commented 4 years ago

This works perfectly. Thank you Nick !

Best regards,

Nicolas

nblumhardt commented 4 years ago

Thanks for the follow-up! 👍