Reputation: 1638
Background: As part of our table design for storing logs we are creating new tables each day. A function will run daily to create these tables. However there is no guarantee the tables will be used on that day. Therefore the function will also delete the previous day's table if there are no rows.
What is the cheapest way to check if table has data? Potential partition and row keys could be quite a lot to check for.
Upvotes: 0
Views: 53
Reputation: 10998
What is the cheapest way to check if table has data? Potential partition and row keys could be quite a lot to check for.
You can simply query the table and fetch just a single entity with $top=1
.
Upvotes: 3