What should I pay attention to when I need to frequently get the field details of the table from the mysql system table? At present, I find that the index is not used.

select fields from information_schema.COLUMNS  where ....
sqlsql
Jan.14,2022

you can cache the table field, key, it with the table name, and then set a certain expiration time, because the table field will change less, so it will be better if you don't have to look up the table every time. The table under


information_schema is memory engine and cannot be indexed. It is normal that SQL does not need an index.
see if you need accurate data. If it is not accurate, you can cache the relevant information first.
if you must check the table every time, it is recommended to do it from the database.


1st floor solution-- cache the fields of the table.
can be implemented in redis,memcached.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e495d8-44d21.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e495d8-44d21.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?