MySQL Forums
Forum List  »  Newbie

Fastest way to check for an image in a table
Posted by: Sebastian Jurk
Date: September 24, 2010 01:57PM


I want to create a database with images. I dont need the images stored but I need to check if there is already an entry for an image.

So I thought one possibility would be to store a hash. But a hash is a string and stringsearches can be slow. At the end there could be millions of hashes in the table. Would fulltext be the thing to do here? And does it matter then what has I use?

I thought maybe it would be faster to add the height and width of the images as well as the number of bytes it has. So that a select can run like select hash where width=x and height=y and size=z and hash='ssss'
This way at first numbers are checked. Probably even with an index. This would probably be faster.

Or am I wrong and what would be the fastest way? Or am I wrong. Remember it should work as fast as possible because at some point it could contain millions of entries. Unique entries. Each hash different.


Options: ReplyQuote

Written By
Fastest way to check for an image in a table
September 24, 2010 01:57PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.