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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:19:26+00:00 2026-05-12T15:19:26+00:00

I have a big MySQL InnoDB table (about 1 milion records, increase by 300K

  • 0

I have a big MySQL InnoDB table (about 1 milion records, increase by 300K weekly) let’s say with blog posts. This table has an url field with index.

By adding new records in it I’m checking for existent records with the same url. Here is how query looks like:

SELECT COUNT(*) FROM `tablename` WHERE url='http://www.google.com/';

Currently system produces about 10-20 queries per second and this amount will be increased. I’m thinking about improving performance by adding additional field which is MD5 hash of the URL.

SELECT COUNT(*) FROM `tablename` WHERE md5url=MD5('http://www.google.com/');

So it will be shorter and with constant length which is better for index compared to URL field. What do you guys think about it. Does it make sense?

Another suggestion by friend of mine is to use CRC32 instead of MD5, but I’m not sure about how unique will be result of CRC32. Let me know what you think about CRC32 for this role.

UPDATE: the URL column is unique for each row.

  • 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-12T15:19:27+00:00Added an answer on May 12, 2026 at 3:19 pm

    Create a non-clustered index on URL. That will let your SQL engine do all the optimization internally and will produce the best results!

    If you create an index on a VARCHAR column, SQL will create a hash internally anyway and using the index can give better performance by an order of magnitude or even more!

    Also, something to keep in mind if you’re only checking whether a URL exists, is that certain SQL products will produce faster results with a query like this:

    IF NOT EXISTS(SELECT * FROM `tablename` WHERE url='')
        -- return TRUE or do your logic here
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a relatively big MySQL InnoDB table (compressed), and I sometimes need to
I have a big MySQL table (around 50 GB, tens of millions of records),
I have a pretty big table with contains about 3 million records. When running
I have a MySQL table storing about 330,000 records at the moment. I need
I have a MySQL table which has a product_id field (big integer) 1102330008 1102330025
I have big records to copy values from table B to table A. Currently
Let's say you have a big web app with large visits, but you don't
Hi I have one big problem with one MYSQL search. My database TABLE looks
I have a MySQL table with about 2 million rows, and a script that
I have a big MySQL users table and need to get six random rows

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.