2

Is it possible to run a query on an Azure Table Storage table without using the PartitionKey. For example, I'd say, RowKey starts with but do not use the PartitionKey

Two questions:

  1. Is it possible to do this?
  2. Is it a good idea to do this? I'm concerned that even if it is possible, it may have a performance penalty associated with it.
Sam
  • 26,817
  • 58
  • 206
  • 383

1 Answers1

2

I found the answer to this question.

The short answer is Yes, it is possible to run a query without using the PartitionKey BUT should NOT be used!

A query without partitionKey will do a table scan and is NOT efficient at all. It is important to mention that a query without a partitionKey will perform a table scan even if a rowKey is used in the query.

Here's the Microsoft article that explains all this: https://azure.microsoft.com/en-us/documentation/articles/storage-table-design-guide/

Sam
  • 26,817
  • 58
  • 206
  • 383
  • As you've found, this results in a table (or partition) scan. However, just for completeness; if your table (or partition) is not too large, it may be fast enough for you. Given the alternatives (separate copies of the data with different index, separate index tables, or separate indices in another database such as db) which are all hard work, don't prematurely optimise :) – O'Rooney Mar 14 '16 at 02:54