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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:46:11+00:00 2026-06-10T03:46:11+00:00

Ever few minutes around 500 paragraphs are supposed to be submitted to the database

  • 0

Ever few minutes around 500 paragraphs are supposed to be submitted to the database in a table called “Content” (this number will go to over 2,500 in a few months).
There is another table called “Keywords” which has over 4,000 rows (and is expected to grow to over 10,000).

Keywords
+------------+-------------------+
| Keyword_id | keyword           |
+------------+-------------------+
|          1 | "Venture Capital" |
|          2 | "Financing"       |
+------------+-------------------+

The question is: What is the best way to scale a solution where each keyword is cross-referenced among an incoming paragraphs of text to see if there is a match?

Since I’m not concerned about where in the paragraph there is a match (my only concern is that there IS a match);
if(preg_match()){} could possibly work but even at the low-end that’s 2,000,000 times you’re running over a paragraph searching for a keyword.
Plus, correct me if I’m wrong, preg_match is pretty expensive.

One of the possibilites that crossed my mind was to keep an array of the keywords in the cache instead of having to call on the DB for every row.
That would definitely help speed things up I think.

I’m not concerned with this being only in PHP.
If this section of the application needs to be in Python (correct me if I’m wrong, but I hear Python is a lot less expensive at parsing text), then I’m all ears.

  • 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-06-10T03:46:13+00:00Added an answer on June 10, 2026 at 3:46 am

    With MySQL:

    Search query: Vent Capit

    Using match against:

    SELECT * FROM keywords WHERE MATCH (keyword) AGAINST ('+Vent* +Capit*' IN BOOLEAN MODE);
    

    If your using _ci collation, (ci stands for case insensitive), the matching would ignore capitalization 🙂

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

Sidebar

Related Questions

How can I update a MYSQL database ever few minutes to an external database?
Ever since .net 2.0 release this question has been discussed over a large number
I've been working on this game with LWJGL for a few weeks now. Ever
I've been having a few problems running PHP-based utilities within the command line ever
Ever since I created this Rails 3.2.3 project to use MiniTest, I have been
In my app, I have an external monitor that pings the app ever few
Im building an application where a few objets outside the mainWindow will need to
This is my first question ever at stackoverflow, hope I make sense out of
Ever since the new Greasemonkey 1.0 was released a few days ago, every site
I've seen a few similar questions but none that quite address this scenario. I

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.