Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4583366
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:12:18+00:00 2026-05-21T21:12:18+00:00

I am a total newbie with Azure! The purpose is to return the rows

  • 0

I am a total newbie with Azure! The purpose is to return the rows based on the timestamp stored in the RowKey. As there is a transaction cost with each query, I want to minimize the number of transactions/queries whilst maintain performance

These are the proposed Partition and Row Keys:

  • Partition Key: TextCache_(AccountID)_(ParentMessageId)
  • Row Key: (DateOfMessage)_(MessageId)

Legend:

  • AccountId – is an integer
  • ParentMessageId – The parent messageId if there is one, blank if it is the parent
  • DateOfMessage – Date the message was created – format will be DateTime.Ticks.ToString(“d19”)
  • MessageId – the unique Id of the message

I would like to get back from a single query the rows and any childrows that is > or < DateOfMessage_MessageId

Can this be done via my proposed PartitionKeys and RowKeys?

ie.. (in psuedo code)

var results = ctx.PartitionKey.StartsWith(TextCache_AccountId) 
   && ctx.RowKey > (TimeStamp)_MessageId

Secondly, if there I have a number of accounts, and only want to return back the first 10, could it be done via a single query

ie.. (in psuedo code)

var results = ( 
      ( 
        ctx.PartitionKey.StartsWith(TextCache_(AccountId1)) && 
            && ctx.RowKey > (TimeStamp1)_MessageId1 )
      )
      ||
      ( 
        ctx.PartitionKey.StartsWith(TextCache_(AccountId2)) && 
            && ctx.RowKey > (TimeStamp2)_MessageId2 )
      ) ... 
          )
         .Take(10)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T21:12:19+00:00Added an answer on May 21, 2026 at 9:12 pm

    The short answer to your questions is yes, but there are some things you need to watch for.

    Azure table storage doesn’t have a direct equivalent of .StartsWith(). If you’re using the storage library in combination with LINQ you can use .CompareTo() (> and < don’t translate properly) which will mean that if you run a search for account 1 and you ask the query to return 1000 results, but there are only 600 results for account 1, the last 400 results will be for account 10 (the next account number lexically). So you’ll need to be a bit smart about how you deal with your results.

    If you padded out the account id with leading 0s you could do something like this (pseudo code here as well)

    ctx.PartionKey > "TextCache_0000000001"
    && ctx.PartitionKey < "TextCache_0000000002"
    && ctx.RowKey > "123465798"
    

    Something else to bear in mind is that queries to Azure Tables return their results in PartitionKey then RowKey order. So in your case messages without a ParentMessageId will be returned before messages with a ParentMessageId. If you’re never going to query this table by ParentMessageId I’d move this to a property.

    If TextCache_ is just a string constant, it’s not adding anything by being included in the PartitionKey unless this will actually mean something to your code when it’s returned.

    While you’re second query will run, I don’t think it will produce what you’re after. If you want the first ten rows in DateOfMessage order, then it won’t work (see my point above about sort orders). If you ran this query as it is and account 1 had 11 messages it will return only the first 10 messages related to account 1 regardless if whether account 2 had an earlier message.

    While trying to minimise the number of transactions you use is good practice, don’t be too concerned about it. The cost of running your worker/web roles will dwarf your transaction costs. 1,000,000 transactions will cost you $1 which is less than the cost of running one small instance for 9 hours.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a total newbie to Excel, and there's a bit of problem I
I'm a total newbie at PHP, but this seems so simple, there doesn't seem
Total newbie question, but I cant figure out what im doing wrong. I want
I'm a total newbie and want to start with php. I know some javascript
I'm a total newbie when it comes to CSS so I've pretty much given
I'm a total newbie at Entity Framework and ASP.Net MVC, having learned mostly from
I am a total newbie in servers/hosting etc, although I have some experience in
I am a total newbie to CSS - am just an iphone developer, and
I`m a total newbie in php, so sorry for my simple question. Need to
I know this is a total newbie question, but the answer may not be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.