The table prefix in mysql should be thrown into the history garbage collection.

Source: Internet
Author: User
Tags database sharding
The table prefix in mysql should be thrown into the history garbage collection. 1. table prefixes are widely used but useless. There is almost no money on the server, and the data is completely free. Is it meaningful for a database to accommodate two databases?
2. it brings great trouble to programming, maintenance, and database maintenance. Like Marxism, Mao XX thought. Only harm, no benefit.

Who can give me a reason to use a prefix ??

You don't have to give me the answer. I will give it myself. In 99.99%, this is not required. I have never used it again.

I want to investigate which project requires the table prefix? Can you introduce it? Check if someone really needs the table prefix?

Points for posting.


Reply to discussion (solution)

If your database supports multiple databases, it makes no sense. if there is only one database, it is helpful to distinguish between tables.

Only one database can be created for the purchased space. It is very useful to add a prefix. you cannot ignore these users.

Only one database can be created for the purchased space. It is very useful to add a prefix. you cannot ignore these users.


A regular 100 yuan space will bring free databases. is it necessary to add two databases to a database?
Buy another space. Why can't a program run in 100 yuan a year?
Local development requires only one database.

I have met and used at least 20 + projects. There is never a prefix, but each project has a prefix.

Prevent malicious high-level user guesses?
It is inevitable that there will be some vulnerabilities in the open-source CMS. Is there a lot of protection for multiple table prefixes?
Used to implement certain functions? For example, Chinese/English versions?

The landlord seems to have a company on his own, right?
Buy another space. Why can't a program run in 100 yuan a year?In this way, you can also speak to your customers?
I just want to put a dede, a Discuz! , A wordpress is put in a space, and you want to add a wiki and Q & A system later.
Doesn't your sales system support this? So why am I spending money on your system instead of using a free open-source system?

Many settings are unreasonable. However, according to relevant departments, this is the historical reason.


Such as computer languages. In fact, if the language is really good, one is enough.

For example, the system had poor support for images and animations because engineers only considered text when they started to build computers. You only need some text on the screen. Although the image algorithm appeared later, the animation algorithm appeared. But these later appeared in the hardware and software environments that originally did not support them, so the files became very large and difficult to use.

To change these defects, you must reconstruct the underlying layer and rebuild the system. But these are impossible. So we will try again.


Mysql is actually irrelevant to several databases. You can also create a table suffix or a table suffix. It's just a naming rule.


Only one database can be created for the purchased space. It is very useful to add a prefix. you cannot ignore these users.


A regular 100 yuan space will bring free databases. is it necessary to add two databases to a database?
Buy another space. Why can't a program run in 100 yuan a year?
Local development requires only one database.



But I? Null? Already ?? Yes ,? Why? Root? Module? Points ??? And? More? Null? What about it? What is the same as 100 yuan? Ah, Big Brother.

The landlord seems to have a company on his own, right?
Buy another space. Why can't a program run in 100 yuan a year?In this way, you can also speak to your customers?
I just want to put a dede, a Discuz! , A wordpress is put in a space, and you want to add a wiki and Q & A system later.
Doesn't your sales system support this? So why am I spending money on your system instead of using a free open-source system?


This cost is 100 RMB. how much effort is spent on code maintenance? more than 1000 RMB?

I am not operating my website to learn how to build a website.
Therefore, it is impossible for me to pay for multiple spaces for your convenience of maintenance. In fact, if I have multiple spaces, isn't it too troublesome for you to maintain them?
Besides, each system runs independently and does not interfere with each other"

I am not operating my website to learn how to build a website.
Therefore, it is impossible for me to pay for multiple spaces for your convenience of maintenance. In fact, if I have multiple spaces, isn't it too troublesome for you to maintain them?
Besides, each system runs independently and does not interfere with each other"


The table prefix will cause trouble for programming and increase the effort required for code maintenance by more than 10 thousand RMB.
No prefix is required. on average, a project can save at least 10 thousand of development and maintenance costs.

I want to know which part of the trouble and difficult maintenance are embodied in?
And ifBuy another space. Why can't a program run in 100 yuan a year?If a database requires multiple prefixes, do you need to buy more space?
Is the prefix just for decoration?

I added a prefix to identify at a glance which functional module these tables belong to. Then, when I search for a table, the range is smaller and the time for finding the table is shorter, don't you just put a bunch of data and find them one by one? Of course, the requirements for different scenarios are also different. if you don't use them, it doesn't mean it's useless.

Even if you do not need a prefix, how many more databases will reduce the maintenance cost for back-and-forth Database Sharding?

Table prefixes do not cause any trouble in programming, especially the encapsulated data layer.
The table prefix is slightly slower because it requires a table name assembly.
The table prefix can enhance the generalization of the program. different applications no longer need to worry about preventing the same table name.
The table prefix allows you to easily replace test data during program development.
It also does not affect the normal operation of the system during maintenance. you only need to assign a config to switch to the simulated data.
Instead of using the table prefix, you may need to back up the database and guard against the exposure of test data to the website.

Of course, the table prefix is only a technical means to facilitate work. It's your own business.

Since you have Java experience, you should also know that Java has abandoned the external file inclusion (# include) of C/C ++ when it is detached from C ++ ). I thought that as long as the class is planned, external files no longer need to be introduced. But things are always so unsatisfactory. in the second year, only one Import can be recreated to make up for it.

Table prefixes do not cause any trouble in programming, especially the encapsulated data layer.
The table prefix is slightly slower because it requires a table name assembly.
The table prefix can enhance the generalization of the program. different applications no longer need to worry about preventing the same table name.
The table prefix allows you to easily replace test data during program development.
It also does not affect the normal operation of the system during maintenance. you only need to assign a config to switch to the simulated data.
Instead of using the table prefix, you may need to back up the database and guard against the exposure of test data to the website.

Of course, the table prefix is only a technical means to facilitate work. It's your own business.

Since you have Java experience, you should also know that Java has abandoned the external file inclusion (# include) of C/C ++ when it is detached from C ++ ). I thought that as long as the class is planned, external files no longer need to be introduced. But things are always so unsatisfactory. in the second year, only one Import can be recreated to make up for it.



Php almost completely does not need to reference external files manually.

I want to know which part of the trouble and difficult maintenance are embodied in?
And ifBuy another space. Why can't a program run in 100 yuan a year?If a database requires multiple prefixes, do you need to buy more space?
Is the prefix just for decoration?

I added a prefix to identify at a glance which functional module these tables belong to. Then, when I search for a table, the range is smaller and the time for finding the table is shorter, don't you just put a bunch of data and find them one by one? Of course, the requirements for different scenarios are also different. if you don't use them, it doesn't mean it's useless.

Even if you do not need a prefix, how many more databases will reduce the maintenance cost for back-and-forth Database Sharding?


I think the reason for the poor prefix lies in quick table searching.
The prefix affects the name of the read table.
What do I think is the meaning of a prefix when I start to look at it. Finally, I found that the fart is meaningless. Is the prefix.

Whether to introduce external files or not is two different categories.

The prefix exists in the quick table search. the same prefix must belong to the same application.
You can regard prefix as a group (classification) flag.

Existence means meaning.
The prefix is used to quickly differentiate meanings between different tables. Of course, if there is no need to distinguish, there is no need to use a prefix.
Maybe you don't think it makes sense to be a fart. it will bring unlimited troubles to your work, and the cost will be greatly improved, so you can discard it. But if you are familiar with it, the table prefix may bring a lot of convenience to other people's work.
In a large application, there may be many associated and highly coupled relational tables, but they do not belong to the same module, and the meaning of the prefix may be reflected. Otherwise, the relationship between tables needs to be upgraded to the database for multi-database operations? But not beautiful ~

In other words, existence means meaning.

After several months of thinking and debate: The conclusion is as follows.
1. there is a positive solution on the 17 th floor upstairs. Xuyanlu
2. the answer is good on the 16th floor.
On the third and sixth floors, your reply may be correct 20 years ago. This is a complete error.

It is necessary to use the prefix as a group, but the entire table is a prefix, which is completely pathological.
There are people like xuzun who want to practice on the internet all day. Because we cannot find three people in China? So ignore.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.