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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:42:55+00:00 2026-05-15T03:42:55+00:00

I have a data table with 600,000 records that is around 25 megabytes large.

  • 0

I have a data table with 600,000 records that is around 25 megabytes large. It is indexed by a 4 byte key.

Is there a way to find a row in such dataset quickly with PHP without resorting to MySQL?

The website in question is mostly static with minor PHP code and no database dependencies and therefore fast. I would like to add this data without having to use MySQL if possible.

In C++ I would memory map the file and do a binary search in it. Is there a way to do something similar in PHP?

  • 1 1 Answer
  • 3 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-15T03:42:55+00:00Added an answer on May 15, 2026 at 3:42 am

    PHP (at least 5.3) should already be optimized to use mmap if it’s available and it is likely advantageous. Therefore, you can use the same strategy you say you would use with C++:

    • Open a stream with fopen
    • Move around for your binary search with fseek and fread

    EDIT: actually, it seems to use mmap only in some other circumstances like file_get_contents. It shouldn’t matter, but you can also try file_get_contents.

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

Sidebar

Related Questions

SQL 2005, 600,000,000 rows. I have a table called Location currently using the data
I have some data in a table that looks roughly like the following: table
I have an Oracle 10g table that contains a # of log records. This
I have a overview page that shows the data in a table. A pop-up
I'm importing more than 600.000.000 rows from an old database/table that has no primary
I have loaded a table of data into an HTML page so that it
I have a database table that contains collection data for product collected from a
I have data table containing one column as FilePath. FilePath D:\New folder\link.txt D:\New folder\SharepointMigration(Work
I have a data table which already has some values, plus it is getting
I have a data table filled with text in each table row. How do

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.