• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 466
  • Last Modified:

Can Pascal and/or C tables be stored completely in memory, e.g. RAM?

If so, can the tables be indexed if held in memory?

Thank You
0
gdamiani123
Asked:
gdamiani123
1 Solution
 
Brian UtterbackPrinciple Software EngineerCommented:
This is certainly possible with C. It is not clear about Pascal, since there is no bundled Pascal compiler in Solaris, so I don't know which one you are using and its characteristics.

However, I suspect that there is morr behind this question, since for C, variables are kept in memory by default. Perhaps there is more to your question? Why do you ask?
0
 
epasquierCommented:
What do you mean by table ?
an array ? or a database of some kind ?

Whatever the language, and probably also whatever the OS (don't know Solaris at all, but that is common sense), if you declare variables in your application they are kept in memory. Now, when your application have too much data in memory, some pages are swaped to harddrive, and then it's another story. Your application has no control over that - except by making sure that you only keep in memory the data you really need in short term, thus reducing the swaping.

About index : if you have a very large array (of records) - ie a table - loaded in memory, searching in this unsorted table might take some time. So yes, that is when some kind of index will be built to make a quick lookup of some records. Your application have to implement its own index for each table/field that need quick lookup. Usually, you will build a hashlist. If you don't know what a hashlist is all about, just ask.
But if your application will need something more than a few lookup fields (by exact value) and/or complex queries (multiple filters), then you should forget the idea of doing it 'the old way' and use a real DBMS with SQL support.
0
 
gdamiani123Author Commented:
Thank you...could you please explain the hashlist.

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now