2
votes

I have Azure table called users which serveral fields related to user, I have PartitionKey as UserId and RowKey as CompanyId and I want to query the table via the Email field which is not an PartionKey or RowKey, Is it possible to query the table like this?

If yes then it is good to query without the PartitionKey and RowKey

2

2 Answers

6
votes

You can query without using PartitionKey or RowKey and table service will not throw any errors however please keep in mind that this will do a full table scan starting from 1st PartitionKey/RowKey combination till the time matching entities are found.

This may not be an issue if your table is small. However it will be an issue if your table becomes big. There would be a chance that you don't get any data back but just the continuation token and you would need to query your table again using that continuation token.

If you want to query on Email field, I would highly recommend duplicating your data so that the Email field becomes the PartitionKey.

Not sure if you have read this already, but I would highly recommend reading Azure Table Storage Design Guide: https://azure.microsoft.com/en-in/documentation/articles/storage-table-design-guide/.

0
votes

Performance by query

You can, but it will be full scan and it's the worst case of using table storage.

You should change your design and you should use at least one of the keys. You can create storage tables for your companies and make your email part of partion key.

Note: Image taken by this article