# Finding the size of all columns in a table

**URL:** <https://forums.percona.com/t/finding-the-size-of-all-columns-in-a-table/18321>\
**Category:** MySQL & MariaDB\
**Created:** [November 2, 2022, 4:58pm UTC](https://forums.percona.com/t/finding-the-size-of-all-columns-in-a-table/18321 "2022-11-02T16:58:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dba1](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dba1/32/24223_2.png) [@Dba1](https://forums.percona.com/u/Dba1)\
**Post date:** [November 2, 2022, 4:58pm UTC](https://forums.percona.com/t/finding-the-size-of-all-columns-in-a-table/18321/1 "2022-11-02T16:58:55Z")

</div>

Greetings  
Is there a query to find all the columns and size of each one in a table in mysql 😄

Thank you

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [November 2, 2022, 5:46pm UTC](https://forums.percona.com/t/finding-the-size-of-all-columns-in-a-table/18321/2 "2022-11-02T17:46:09Z")

</div>

Hi @Dba1  
If you are looking to gather information about your schema such as max char limits and column names + types, you can use `INFORMATION_SCHEMA`.`COLUMNS`, for example:

```auto
SELECT 
    table_schema,
    table_name,
    column_name,
    data_type,
    character_maximum_length
FROM
    information_schema.columns
WHERE
    table_schema NOT IN ('information_schema' , 'performance_schema', 'sys');

```

---

<div class="post-metadata">

**Author:** ![Dba1](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dba1/32/24223_2.png) [@Dba1](https://forums.percona.com/u/Dba1)\
**Post date:** [November 2, 2022, 7:03pm UTC](https://forums.percona.com/t/finding-the-size-of-all-columns-in-a-table/18321/3 "2022-11-02T19:03:35Z")

</div>

Thanks you for your reply  
basically I’m looking to find out the size of a particular field(column\_name). I have a column with a “BLOB” data type, I’m trying to find out if the size of this column is causing the sudden increase we are seeing in the table.

Thank you

Note

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [January 17, 2023, 4:08pm UTC](https://forums.percona.com/t/finding-the-size-of-all-columns-in-a-table/18321/4 "2023-01-17T16:08:38Z")

</div>

Hi @Dba1 sorry about the tardy reply, I didn’t see this in my inbox until now ☹

You can use something like the `LENGTH()` function:

```auto
SELECT LENGTH(`MY_BLOB_COLUMN`) FROM my_table ORDER BY LENGTH(`MY_BLOB_COLUMN`) DESC;

```
