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

Posted on 2011-10-10
Last Modified: 2013-12-27
If so, can the tables be indexed if held in memory?

Thank You
Question by:gdamiani123
    LVL 22

    Expert Comment

    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?
    LVL 25

    Accepted Solution

    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.

    Author Comment

    Thank you...could you please explain the hashlist.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    Expiration of TSM data 17 79
    g++ pthread_init failure on AIX 10 64
    Using idhttp to login to instagram 2 49
    Global Keyboard Hooks Blocked 4 35
    Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
    Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode ( They will have you believe that Unicode requires you to use…
    The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
    In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now