我需要在Laravel数据库中使用原始查询:查询构建器,输出特定表的大小。
在核心mysql查询中,如下所示:
SELECT table_name "Name_of_the_table", table_rows "Rows Count", round(((data_length + index_length)/1024/1024),2)
"Table Size (MB)" FROM information_schema.TABLES WHERE table_schema = "Name_of_the_Database" AND table_name ="Name_of_the_table";