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 9117255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:51:43+00:00 2026-06-17T04:51:43+00:00

I am using windows azure table storage. My problem is that the access of

  • 0

I am using windows azure table storage. My problem is that the access of entities for a given user from table is taking long time. The code which i am using to access the table is as follows :

   public CloudTableQuery<T> GetEntites(string username)  
   {
        try
        {
            CloudTableQuery<T> entries =
                (from e in ServiceContext.CreateQuery<T>(TableName)
                 where e.PartitionKey == username
                 select e).AsTableServiceQuery();

            return entries;
        }
        catch (Exception)
        { return null; }
    }

The total entities in the table are currently only 100 or so. For example : The query seems to take as long as 40 seconds to return 25 entities for a given user. Please suggest if there is any scope for improvement in the code for faster performance ?

  • 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-06-17T04:51:44+00:00Added an answer on June 17, 2026 at 4:51 am

    The real problem here is you are returning queries instead of entities, and you are likely executing a query again for each returned entity (query). Define your entity with something like:

    public class UserEntity
    {
        public string UserName { get; set; }
        public string Name { get; set; }
        public string Email { get; set; }
    }
    

    Then define your table storage entity with something like:

    public class StoredUserEntity : TableServiceEntity
    {
        public StoredUserEntity (string username)
        {
            this.PartitionKey = username;
            this.RowKey = Guid.NewGuid().ToString();
            this.Timestamp = DateTime.Now;
        }
    
        public string Email { get; set; }
        public string Name { get; set; }
    }
    

    Then your query should actually return a list of UserEntities:

        public List<UserEntity> GetUserData(string username)
        {
            var q = _tableContext.CreateQuery<StoredUserEntity>(_tableName);
            return
                q.ToList().Select(x => new UserEntity {UserName = x.PartitionKey, Email = x.Email, Name = x.Name}).Where(x => x.UserName == username).ToList();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using windows azure blob storage. My problem is that the blob access
I am having a problem reading back from windows azure table storage: Here is
Hi all i want to access azure tables entities from windows phone either using
I'm using Windows Azure Table Storage to store millions of entities, however I'm trying
I am using Windows Azure Table Storage. I am wondering, if I could use
I am working a sample application using Windows Azure table storage. I will try
We are using windows azure table for logging errors within our applications hosted inside
I am trying to get a single entity from azure table using Patitionkey and
I'm considering using Fat Entities from Lokad.Cloud in a new Azure based application. At
I um using Windows Azure toolkit for Windows Phone from codeplex. After creating a

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.