简体   繁体   English

比较存储在mysql数据库中的图像

[英]Compare images stored in mysql db

I know I can store images in mysql as data type blob. 我知道我可以将图像作为数据类型Blob存储在mysql中。 Wandering if i can compare the blob values in my query? 我是否可以在查询中比较Blob值?

Eg select answer from mtTable where imageBlobValue = image010. 例如,从mtTable中选择答案,其中imageBlobValue = image010。

Here imageBlobValue and image010 data type is blob. 这里的imageBlobValue和image010数据类型为blob。

TIA TIA

Well, while that should be theoretically possible, a more optimal way to handle this would be to store an image hash or some other unique identifier alongside the blob to use for query purposes. 嗯,虽然从理论上讲应该是可行的,但处理此问题的最佳方法是将图像散列或其他唯一标识符存储在Blob旁边,以用于查询目的。

You want to minimize the amount of times the database has to handle that blob in memory and the best way to do that is to have a suitable key to search on. 您希望最大程度地减少数据库处理内存中该blob的次数,而做到这一点的最佳方法是找到合适的密钥。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM