Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
データベースに大量のブロブ データがあり、それぞれの重み (400kb、14.2kb など) を取得する必要があります。
どうやってやるの?
SQL では:
SELECT some_key, LENGTH(blob_column) AS size_in_bytes FROM the_table
PHP の場合:
$sizes = array(); foreach (how_you_query_the_db('SELECT some_key, blob_column FROM the_table ') as $row) $sizes[$row['some_key']] = strlen($row['blob_column']);