Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Table Storage get last record

I have an azure table with about 5 million+ rows, each partition about 100k rows. The RowKey is a sortable timestamp. I need to be able to get the latest record that was inserted in the table.

Since Linq Last, Max, OrderBy etc are not supported, how do I efficiently get the most recent table record?

like image 545
James Reategui Avatar asked May 01 '12 04:05

James Reategui


1 Answers

There's no efficient way to do this. But if it's an option, consider flipping your row key so that the newest entries are on the top (reverse chronological order). Retrieving the top n entries is easy and efficient.

like image 186
user94559 Avatar answered Sep 19 '22 15:09

user94559