Yes, adding a prefix that denotes the type of the object is a problem, and unnecessary. Because,
- Sometimes objects begin life as something but will end up becoming something else. (e.g. table
tblXxx was split into
tblXxxZ for some reason and replaced with a view that joins the two new tables. Now you have a view called
- When you type
tbl in the editor, its AutoComplete feature hangs for 45 seconds and then shows you a list of 4000 entries.
I'm going to play devil's advocate and say something others have outright advised against. There are some rare cases a suffix/prefix could be useful, and here's an example from the organization I work for.
We have an entity based ERP system, where the business logic is written in Oracle PL/SQL. It's nearly two decades old, yet a very stable system (This is not a legacy system. We are continuously developing it).
The system is entity based, and each entity associates a table, multiple views, multiple PL/SQL packages, and a host of other database objects.
Now, we want the objects belonging to the same entity to have the same name but yet to be distinguishable of it's purpose and type. So, if we have two entities that are named
CustomerInvoice, we'll have following objects:
- Tables to store data [
- Views that are used by clients [No suffix]:
- Interface for basic operations; (PL/SQL packages) [
- Report generators; (PL/SQL packages) [
- Indexes for primary keys [
- Secondary indexes [
XXX describes the usage of the index).
- ... and so on.
This is indeed a form of Apps Hungarian (note that same type of objects can have different suffixes depending on the purpose). But, with a suffix instead of a prefix. I can't tell you enough how this system is so easy to read. IntelliSense actually works because instead of typing
TBL and getting 4000 results, I can type
Customer and get all the objects belonging to entities named
So, here I have showed you how metadata can be useful. The purpose is to have a related set of database objects identifiable by a single name, yet differentiate them based on their purpose.
Having said that, if you don't have this kind of system, there is no use of either prefixing or suffixing the type of object.
Note that we haven't used suffixes like
_view (i.e. the type of the object). For example, both (3) and (4) are PL/SQL packages, yet use a different suffix. It's the same for (5) and (6), both of which are indexes. So the suffix is based on purpose rather than the type.