Simple convert the datetime you need to ticks using the following code: So querying your serilogs by including the PartitionKey instead of the timestamp improves performance greatly. The PartitionKey in Serilog is the current UTC datetime converted to ticks. When looking at Serilog in the context of logging to Azure Table Storage, it uses the PartitionKey for an alternative to the already present timestamp-column (which is managed by Azure itself, so in essence it’s a duplicate value). A better way to query Azure Table Storage for timestamps For example, I would query the logs of the last 15 minutes, or within a certain datetime range. I often ran into a performance issue when using Serilog with Azure Table Storage as many of my log-queries included the timestamp in one way or another. Serilog lets you output your logs to many different systems and services, including Azure Table Storage. Sometimes however, the table design is out of your hands, take Serilog for example. Queries that do not include either of these indexes will be (a lot) slower due to the lack of an index so it is crucial to keep these indexes in mind when designing your table(s). Azure Table Storage only has an index on the PartitionKey and RowKey columns (as a clustered index), and on the table and account name itself. One important thing to realise is that querying performance for Azure Table Storage is completely driven by its indexes. Proper use of the PartitionKey and RowKey-field is the primary factor in getting the best performance out of your Table Storage. Source = AzureStorage.Let me start of by saying that in general, having good azure table storage querying performance comes down to having a solid table design. I am looking for something similar to the Azure Table REST query param: ()?$top=10 (from ) I tried Table.FirstN, but it seems to load all entries from the table and then only take the first N in memory. Also, doing a filter on the timestamp is super slow. Loading all hundres of GB would take hours and crash PowerBI, so I need to limit the results. I am trying to get only the Top N entries from an Azure Table.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |