Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know if other database have something equivalent to MRG_MYISAM (aka the MERGE table type/storage engine)?

I know about fragmenting, but this is not quite the same AFAIK. We're using MRG_MYISAM to avoid large amounts of duplicate data across customer specific databases, so MRG_MYISAM is perfect.

That said, I'd like to know if there are equivalent things in other DBs, particularly other open source DBs.

share|improve this question

closed as not constructive by RolandoMySQLDBA, Mark Storey-Smith, Max Vernon, Marian, Derek Downey Apr 22 '13 at 14:54

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

I'm curious what your use case is. In most (all?) other RDBMS', 'database' and 'schema' are two separate concepts, and you'll probably run into access issues depending on what your usage of 'databases' is. I found an interesting article on SO regarding postgres. Using his example you could set a partitioned table in the shared schema. But I'm about 74.2% sure that MERGE was MySQL's early attempt at partitioning, so won't exist anywhere else. It's one of a kind (and should be put to rest)...imho – Derek Downey Apr 19 '13 at 1:33
The only thing in postgresql I can think of that might be used to solve the same problem is FOREIGN DATA WRAPPERS These allow you to access data from another database which doesn't even have to be postgresql. However this feature isn't very mature yet. As this is part of the SQL standard I would expect some other big vendors to also support this. – Eelke Apr 19 '13 at 5:31

From the description of the MERGE table type in the MySQL documentation at it appears this is similar to creating a view that uses a UNION statement to connect multiple tables, either from a single database or multiple databases.

In Microsoft SQL Server (which admittedly is not open-source), you could do something like this:

CREATE VIEW MergedTablesView
    SELECT Field1, Field2, Field3, ...
    FROM Database1.dbo.Table1
    SELECT Field1, Field2, Field3, ...
    FROM Database1.dbo.Table2
    SELECT Field1, Field2, Field3, ...
    FROM Database1.dbo.Table3


The UNION statement will remove duplicate rows from the result set, which seems to be your primary requirement.

I'm certain other database engines, including PostgreSQL, also implement the UNION keyword in a very similar manner. Here is the PostgreSQL Manual on the UNION statement.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.