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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T09:52:19+00:00 2026-05-16T09:52:19+00:00

I am trying to extract duplicate rows from my database. I have a listings

  • 0

I am trying to extract duplicate rows from my database. I have a listings table and a listings_meta table which holds additional information. The listings_meta table has over 16,000 rows. When I run the query below it runs REALLY slow.

I don’t understand why. Is there something wrong with my code?

SELECT l.id FROM listings AS l
   LEFT JOIN listings_meta AS lm ON lm.listing_id = l.id AND lm.meta_key = 'email'
   LEFT JOIN listings_meta AS lm2 ON lm2.listing_id = l.id AND lm2.meta_key = 'submitter_email'
   WHERE lm.meta_value = 'test@test.com' OR lm2.meta_value = 'test@test.com' OR l.listing_title RLIKE 'Test'
   GROUP BY l.id LIMIT 1

Are there certain things I can do to improve load time of large tables in general?

  • 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-16T09:52:20+00:00Added an answer on May 16, 2026 at 9:52 am

    Indexes

    Do you have any indexes – particularly on LISTINGS_META.listing_id?

    I re-wrote your query as:

       SELECT l.id 
         FROM listings AS l
    LEFT JOIN listings_meta AS lm ON lm.listing_id = l.id 
                                 AND lm.meta_key = 'email'
                                 AND lm.meta_value = 'test@test.com'
    LEFT JOIN listings_meta AS lm2 ON lm2.listing_id = l.id 
                                  AND lm2.meta_key = 'submitter_email'
                                  AND lm2.meta_value = 'test@test.com'
        WHERE l.listing_title RLIKE 'Test'
     GROUP BY l.id LIMIT 1
    

    WHERE clause

    RLIKE (any of the MySQL regex functionality for that matter) is on par with:

    WHERE l.listing_title LIKE '%Test%'
    

    Neither can make use of an index on the LISTING.listing_title column…

    The best way to improve the listing_title search would be if the LISTING table is MyISAM, so you could add a Full Text Index to the LISTING.listing_title column in order to use:

    WHERE MATCH(l.listing_title) AGAINST ('Test')
    

    …but mind that the minimum word length is 3 characters for Full Text Searching (FTS)….

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

Sidebar

Related Questions

I am trying to extract a table of values from an excel (2003) spreadsheet
I'm trying to extract all matches from a EBML definition, which is something like
I'm trying to parse a html page and extract 2 values from a table
I'm trying to extract EXIF information from images using jQuery. I've tried using a
I'm trying to extract a string (which contains an integer) from an array and
Im trying to extract a line from wget's result but having trouble with it.
I'm trying to extract the domain name from a string in C#. You don't
I'm trying extract the nth + 1 and nth + 3 columns from a
Trying to extract variable names from paths (variable is preceded with : ,optionally enclosed
Im trying to extract a YouTube link from just random text. e.g. This is

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.