Do underscores in a MySQL table names cause issues?

前端 未结 11 924
不知归路
不知归路 2021-02-06 22:17

Do underscores in table names affect performance or cause issues on some platforms?

For example, user_profiles

Would it be better to use user

11条回答
  •  梦毁少年i
    2021-02-06 23:11

    Many database visualization tools such as SQuirreL SQL and DbVisualizer also treat the underscore as a wildcard of sorts, grouping tables "matching" into a tree. For example, a table "document_a" and related tables "document_a_details", "document_a_history". In DbVisualizer, looking at the "document_a" table shows columns for all three tables.

    This is generally not a problem, but can be confusing. For example, using SQuirreL SQL's graphing tools to generate ERDs combines columns from multiple tables into a single table and draws connectors for the relationships of all of these columns in the ERD. This results in relationships being drawn that don't actually exist.

    For this reason, I would not include underscores in table names.

提交回复
热议问题