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

  • Home
  • SEARCH
  • 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 6363763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:04:40+00:00 2026-05-25T00:04:40+00:00

by Random Access i do not mean selecting a random record, Random Access is

  • 0

by Random Access i do not mean selecting a random record,
Random Access is the
ability to fetch all records in equal time,
the same way values are fetched from an array.
From wikipedia: http://en.wikipedia.org/wiki/Random_access

my intention is to store a very large array of strings, one that is too big for memory.
but still have the benefit or random-access to the array.

I usally use MySQL but it seems it has only B-Tree and Hash index types.

I don’t see a reason why it isn’t possible to implement such a thing.
The indexes will be like in array, starting from zero and incrementing by 1.

I want to simply fetch a string by its index, not get the index according to the string.
The goal is to improve performance. I also cannot control the order in which the strings
will be accessed, it’ll be a remote DB server which will constantly receive indexes from
clients and return the string for that index.

Is there a solution for this?

p.s I don’t thing this is a duplicate of Random-access container that does not fit in memory?
Because in that question he has other demands except random access

  • 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-25T00:04:41+00:00Added an answer on May 25, 2026 at 12:04 am

    You are talking about constant time, but you mention a unique incrementing primary key.

    Unless such a key is gapless, you cannot use it as an offset, so you still need some kind of structure to look up the actual offset.

    Finding a record by offset isn’t usually particularly useful, since you will usually want to find it by some more friendly method, which will invariably involve an index. Searching a B-Tree index is worst case O(log n), which is pretty good.

    Assuming you just have an array of strings – store it in a disk file of fixed length records and use the file system to seek to your desired offset.

    Then benchmark against a database lookup.

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

Sidebar

Related Questions

For a simple linked list in which random access to list elements is not
I'm trying to update a random-access binary file using the std::iostream interface with separate
I have a problem getting boost::multi_index_container work with random-access and with orderd_unique at the
I'd like to be able to do random access into a gzipped file. I
If I try and access some random string in the URL of my rails
Having an issue with random individuals trying to access an intranet site with a
I'm running into a scenario where at random times I am getting Access Denied
A random class definition: class ABC: x = 6 Setting some values, first for
I've been using std::istream and ostream as a polymorphic interface for random-access binary I/O
I want to display 1 random record from a database based on the week.

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.