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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:08:58+00:00 2026-05-13T17:08:58+00:00

I have a table with 4 columns and N rows. At the beginning N

  • 0

I have a table with 4 columns and N rows. At the beginning N will be around 1000 and will have tendency to grow up to 3000.

  • 1st: string unique
  • 2nd: int with N/5 unique values
  • 3rd: int with 5 unique values
  • 4th: data value

The objective is to get to the value of the 4th column with different queries, ex: “get the value, where the 1st column is 17”, or: “get all values where the 2nd column is 7”, or: “does any row has this data”. ~40% of queries will be done against the 4th column, ~30% against 3rd, ~20% 2nd and ~10% for 1st.

Since there would be around 100 queries per second, and around 2 changes (add/update/remove) per second against this table, I was wondering, what would be the fastest way (in C#) to manage this data? Memory is not an issue

I’m currently using a SortedDictionary, where the key is the 4th data value; and the dictionary’s value is a class containing the first three values. Verifying the “4th column” is now easy by just using ContainsKey; and when querying by other values I use:

foreach(var object in Objects) if(Objects[Data].2nd==object.Value.2nd) {...}

Any suggestions appreciated.

  • 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-13T17:08:58+00:00Added an answer on May 13, 2026 at 5:08 pm

    This is the equivalent problem of how much indexing to use on a table in a database. If you want fast lookups on all 4 columns, you could created SortedDictionarys of each column type, and use the corresponding dictionary for lookups, but this will increase your add/update/remove time by having to update all 4 dictionaries (not to mention locking as well). It all depends on how fast you want updates and lookups on different columns to be.

    However, given that multiple columns can have the same data, and SortedDictionary depends on unique key values, you may want to either write your own datastructure or use one of the MultiSet classes available in C# collection libraries (C5 springs to mind, but there are several others)

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

Sidebar

Related Questions

i have a table with columns ID,SUBJECT,BRANCH i have select the rows which satisfies
I have a table - xxxx_nb_lo_update_date - with a number of columns and rows
I have table of 5000+ rows and 8+ columns like, Station Lat Long Date
I have a simple HTML Table (10 columns x 500 rows). When the page
I have a table with 18 columns (all Ints) and 1040 rows. If any
I have a table of class players with 5 columns and 40 rows. I
I have a table with a few thousand rows. The table contains two columns,
I have a data table with many rows and columns. How can I display
I have a table with ~200 million rows and ~15 columns in it. I
We have a large table (450 million rows containing 34 columns of numeric or

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.