How to find in a MySQL table the heaviest rows

You can try this code, to find the the heaviest rows in a given column of a table:

SELECT id, LENGTH(your column) AS byte_size
FROM your-table
WHERE LENGTH(your column) > 500 [you can adapt this number to your needs]
ORDER BY byte_size DESC;

This can helpful if you want free your table of useless data, moving them i.g. to external txt or md files.

Lascia un commento

Il tuo indirizzo email non sarĂ  pubblicato. I campi obbligatori sono contrassegnati *