sql - Memory consumption of having a column LONGTEXT in MySQL database -


i'm creating log table in mysql database. 1 of field used in approximately 5% of logs , contains stack traces , others lengthy informations developers. considering using longtext field wondering if using make database grow quickly, if column empty in 95% of rows.

so question in clear, there memory consumption of having longtext column when column empty in of rows? example, if use text instead , truncate strings long, save lot of space on database.

it's important add there lot of logs on time.

thanks!

although varies 1 difference of mysql another, in general terms blob-type columns longtext inherently variable length , take no storage when not used. space needed them isn't allocated in case of null value.

as concerns scaling, there's 1 way find out: generate gigantic amount of log data test schema you're intending use. push full dies, , metrics on how can handle. that'll give idea of how viable approach is.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -