Hangfire
Hangfire copied to clipboard
Idea to improve Sql server query performance with timestamp column
A timestamp column is an automatically increased value (db) globally unique binary value, on every row update, maintained by the SQL Server engine.
Since the timestamp column can be indexed it could potentially allow much faster querying for queries of the type "give me changed rows since last check", by adding a where condition in tsql pseudocode style WHERE row.timestamp.ToBinary() > @LASTCHECKED
Is it worth investigating with performance testing of some large datasets ?
Victor, could you tell me what table and query are talking about?
I just assumed the database querying was a bit of a bottleneck seeing your poll default to 15 secs. I haven't had time to check which queries would benefit the most. Guessing that any periodic hotspot queries checking checking for updates could rely on on initial super quick query just to check the top(timestamp) value to lookup if table has been touched at all since a cached @lastChangedTimestamp. That way you wouldn't need to issue the full query every n:th second.