-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
phpMyAdmin version
6.0.0-dev
Describe the feature
Each time a table is created, or new columns are added, the Collation select is populated with ~196 kB of data for each column that will be added. For a table with 10 columns, this results in ~1960 kBs of used bandwitdh and also a lot of the browser's memory is also used to decompress the data and parse the HTML from JSON.
Collation is not required by default when you create a table or add new columns, since it will use the database/server collation. New columns can be added if this select is empty.
In case the user wants to change the Collation, a HTTP request should be made to fetch the data on the fly.
Here is a video that shows how much time is spent to create a table with 20 columns (7 seconds for the browser to parse the HTML from JSON):
Before:
27.11.2025_23.16.47_REC.mp4
After:
27.11.2025_23.48.09_REC.mp4
Describe the solution
When clicking on the Collation select it should request the collations and populate the select. Also, the value should be stored in memory, to allow usage of the options on other select, if needed.
Additional context
| <select lang="en" dir="ltr" name="field_collation[{{ column_number }}]" id="field_{{ column_number }}_{{ ci - ci_offset }}" class="form-select"> | |
| <option value=""></option> | |
| {% for charset in charsets %} | |
| <optgroup label="{{ charset.name }}" title="{{ charset.description }}"> | |
| {% for collation in charset.collations %} | |
| <option value="{{ collation.name }}" title="{{ collation.description }}" | |
| {{- column_meta['Collation'] is defined and collation.name == column_meta['Collation'] ? ' selected' }}> | |
| {{- collation.name -}} | |
| </option> | |
| {% endfor %} | |
| </optgroup> | |
| {% endfor %} | |
| </select> |
phpmyadmin/resources/templates/columns_definitions/column_definitions_form.twig
Lines 93 to 105 in a700ba5
| <select lang="en" dir="ltr" name="tbl_collation"> | |
| <option value=""></option> | |
| {% for charset in charsets %} | |
| <optgroup label="{{ charset.name }}" title="{{ charset.description }}"> | |
| {% for collation in charset.collations %} | |
| <option value="{{ collation.name }}" title="{{ collation.description }}" | |
| {{- collation.name == tbl_collation ? ' selected' }}> | |
| {{- collation.name -}} | |
| </option> | |
| {% endfor %} | |
| </optgroup> | |
| {% endfor %} | |
| </select> |