Home » Performance » MySQL » complex website database
complex website database [message #3385] Fri, 08 August 2008 05:07 Go to next message
mumuri  is currently offline mumuri
Messages: 3
Registered: August 2008
Junior Member
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 -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


[Updated on: Fri, 08 August 2008 06:11]

Re: complex website database [message #3389 is a reply to message #3385 ] Sat, 09 August 2008 10:05 Go to previous messageGo to next message
Speeple  is currently offline Speeple
Messages: 91
Registered: August 2006
Member
Why not consolidate the two tables into a single table with a tinyint (1 byte) column "site_id"?


Martin Gallagher | Speeple: The latest news
Re: complex website database [message #3392 is a reply to message #3385 ] Sat, 09 August 2008 13:04 Go to previous messageGo to next message
mumuri  is currently offline mumuri
Messages: 3
Registered: August 2008
Junior Member
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
Re: complex website database [message #3394 is a reply to message #3385 ] Sat, 09 August 2008 13:25 Go to previous messageGo to next message
james  is currently offline james
Messages: 17
Registered: September 2007
Location: Arlington, TX
Junior Member

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.
Re: complex website database [message #3403 is a reply to message #3394 ] Sun, 10 August 2008 11:06 Go to previous message
mumuri  is currently offline mumuri
Messages: 3
Registered: August 2008
Junior Member
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 n-all-performance/)

[Updated on: Sun, 10 August 2008 11:09]

Previous Topic:ROW SIZE????
Next Topic:Help optimizing a query not to use filesort
Goto Forum:
  



Current Time: Fri Dec 5 11:27:26 EST 2008

Total time taken to generate the page: 0.02160 seconds
.:: Contact :: Home :: MySQL Support by Percona.com ::.

Powered by: FUDforum 2.7.5.
Copyright ©2001-2006 FUD Forum Bulletin Board Software

MySQL Performance | Forum authority Badge