Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In-Memory Table Data structure

I would like to build an in-memory table data structure with 4 columns so I can look up values based on any combination of the columns (using linq for example). Is there a built-in data type for this or do I have to craft one myself (obviously I can't)?

like image 536
Steven Avatar asked Jul 01 '11 09:07

Steven


People also ask

What is an in memory data structure?

In-memory databases are purpose-built databases that rely primarily on memory for data storage, in contrast to databases that store data on disk or SSDs. In-memory data stores are designed to enable minimal response times by eliminating the need to access disks.

What are in memory tables?

In-memory optimized table—data is stored in the data and delta file pairs. It is also called a checkpoint-file-pair (CFP). The data file is used to store DML commands and the delta file is used for deleted rows. During DML operations many CFPs will be created, this causes increased recovery time and disk space usage.

Which data structure is used in main memory?

The representation of particular data structure in the main memory of a computer is called as storage structure. For Examples: Array, Stack, Queue, Tree, Graph, etc.

What is in-memory database example?

It means that each time you query a database or update data in a database, you only access the main memory. So, there's no disk involved into these operations. And this is good, because the main memory is way faster than any disk. A good example of such a database is Memcached.


2 Answers

Unless you have something specific in mind, I would declare a type with 4 properties with suitable names and types, i.e.

public class SomethingSuitable {
    public int Foo {get;set;}
    public string Bar {get;set;} 
    public DateTime Blap {get;set;}
    public float Blip {get;set;} 
}

and use any list/array/dictionary etc as necessary, or just

data.Single(x => x.Bar == "abc");

etc.

like image 54
Marc Gravell Avatar answered Sep 19 '22 16:09

Marc Gravell


Check DataTable class.

like image 35
Incognito Avatar answered Sep 20 '22 16:09

Incognito