When configuring the SQL Server sink using ColumnOptions.TimeStamp.NonClusteredIndex = true
, the sink creates a non-clustered index on the TimeStamp
column, but the index is always ascending.
Like this:
CREATE NONCLUSTERED INDEX [IX1_Logs] ON [Infinity].[Logs]
(
[TimeStamp] ASC
)
There is currently no way to specify index direction (e.g., DESC
) through the API. This limits performance optimizations, especially for queries retrieving the most recent logs first.
Proposal:
Extend the TimeStamp
column options to allow configuring the index direction. For example:
columnOptions.TimeStamp.NonClusteredIndex = true;
columnOptions.TimeStamp.NonClusteredIndexDirection = IndexDirection.Descending;
Use case:
- Optimize queries for latest logs (
ORDER BY TimeStamp DESC
).
- Improve performance on large log tables.