# Complex website database

**URL:** <https://forums.percona.com/t/complex-website-database/873>\
**Category:** Other MySQL® Questions\
**Created:** [August 8, 2008, 3:37am UTC](https://forums.percona.com/t/complex-website-database/873 "2008-08-08T03:37:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mumuri](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@mumuri](https://forums.percona.com/u/mumuri)\
**Post date:** [August 8, 2008, 3:37am UTC](https://forums.percona.com/t/complex-website-database/873/1 "2008-08-08T03:37:36Z")

</div>

Hello, i m new to this forum

I ve got a little question about a database structure

for two given website, i have one database

database

table:articles\_site1  
table:articles\_site2  
table:users

when i m logged in the first website, the article are taken from article\_site1

when i m logged in the second website, the article are taken from article\_site2

when i m logged in the second website, i m logged in the first website (vice versa)

* * *

now i would like to do a view of an union of articles\_site1 and articles\_site2, in order to display information (like similar discusions for an article) taken from the union of the two tables

what is the best chose temporarytable or merge, i think it s temporarytable but i m not sure, my other problem is that fulltext is not supported on view,

i looked at this article, but didn’t manage to find the answer  
[http://www.mysqlperformanceblog.com/2007/08/12/mysql-view-as](http://www.mysqlperformanceblog.com/2007/08/12/mysql-view-as) -performance-troublemaker/

i was thinking to merge this two articles\_siteX table in one, and to update them via a cron at night, will this give me bette performance ?

thanks in advance

---

<div class="post-metadata">

**Author:** ![Speeple](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Speeple](https://forums.percona.com/u/Speeple)\
**Post date:** [August 9, 2008, 8:35am UTC](https://forums.percona.com/t/complex-website-database/873/2 "2008-08-09T08:35:35Z")

</div>

Why not consolidate the two tables into a single table with a tinyint (1 byte) column “site\_id”?

---

<div class="post-metadata">

**Author:** ![mumuri](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@mumuri](https://forums.percona.com/u/mumuri)\
**Post date:** [August 9, 2008, 11:34am UTC](https://forums.percona.com/t/complex-website-database/873/3 "2008-08-09T11:34:58Z")

</div>

hello

thanks for your answer,

indeed i could do that, but i m using a “ready to serve” cms, and that will be too much work for maintenance

---

<div class="post-metadata">

**Author:** ![james](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@james](https://forums.percona.com/u/james)\
**Post date:** [August 9, 2008, 11:55am UTC](https://forums.percona.com/t/complex-website-database/873/4 "2008-08-09T11:55:01Z")

</div>

Why not just do

SELECT \* FROM articles\_site1  
UNION  
SELECT \* FROM articles\_site2

Then you can take advantage of the fulltext indexes on each table and sort the final results.

---

<div class="post-metadata">

**Author:** ![mumuri](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@mumuri](https://forums.percona.com/u/mumuri)\
**Post date:** [August 10, 2008, 9:36am UTC](https://forums.percona.com/t/complex-website-database/873/5 "2008-08-10T09:36:34Z")

</div>

hello

the goal is to hide complexity (as i m using this view for similar discussion and other stuff)

thanks

more over i ve done a “union all” (see [http://www.mysqlperformanceblog.com/2007/10/05/union-vs-unio](http://www.mysqlperformanceblog.com/2007/10/05/union-vs-unio) n-all-performance/)
