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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:59:54+00:00 2026-06-07T04:59:54+00:00

mysql> EXPLAIN SELECT col1, col2 FROM t WHERE col1 REGEXP ‘^foobar_[0-9]{4}$’; +—-+————-+—————+——+—————+——+———+——+——–+————-+ | id

  • 0
mysql> EXPLAIN SELECT col1, col2 FROM t WHERE col1 REGEXP '^foobar_[0-9]{4}$';
+----+-------------+---------------+------+---------------+------+---------+------+--------+-------------+
| id | select_type | table         | type | possible_keys | key  | key_len | ref  | rows   | Extra       |
+----+-------------+---------------+------+---------------+------+---------+------+--------+-------------+
|  1 | SIMPLE      |        t      | ALL  | NULL          | NULL | NULL    | NULL | 757000 | Using where | 
+----+-------------+---------------+------+---------------+------+---------+------+--------+-------------+
1 row in set (0.15 sec)

mysql> DESCRIBE t;
+------------------------+------------------------+------+-----+---------+-------+
| Field                  | Type                   | Null | Key | Default | Extra |
+------------------------+------------------------+------+-----+---------+-------+
| col2                   | varchar(255)           | NO   | MUL | {}      |       | 
| col1                   | varbinary(255)         | NO   | PRI |         |       | 
+------------------------+------------------------+------+-----+---------+-------+
2 rows in set (0.22 sec)
  • 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-07T04:59:55+00:00Added an answer on June 7, 2026 at 4:59 am

    if you have a index on col1, and add a LIKE like this:

    SELECT col1, col2
    FROM t 
    WHERE col1 LIKE 'foobar_%' AND col1 REGEXP '^foobar_[0-9]{4}$';
    

    you should get abit more speed.

    you can also make an index of (col1, col2) to make mysql store a copy of that table in memeory

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

Sidebar

Related Questions

mysql> select count(*) from table where relation_title='xxxxxxxxx'; +----------+ | count(*) | +----------+ | 1291958
mysql> EXPLAIN SELECT * FROM urls ORDER BY RAND() LIMIT 1; +----+-------------+-------+------+---------------+------+---------+------+-------+---------------------------------+ | id
I have the following mysql query: EXPLAIN SELECT id, name, title, description, time FROM
Is there a difference between the following two statements: mysql> EXPLAIN SELECT IF(arms IS
The following MySQL query completes in under 0.02 seconds : SELECT * FROM `Table1`
What is the meaning of Select tables optimized away in MySQL Explain plan? explain
Why does Mysql optimizer choose the secondary index when doing a 'select * from
EXPLAIN SELECT * FROM content_link link STRAIGHT_JOIN content ON link.content_id = content.id WHERE link.content_id
EXPLAIN SELECT node_id FROM node WHERE person_id IN (SELECT person_id FROM user WHERE is_locked
This query doesn't complete in a reasonable amount of time: mysql> select * from

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.