1

I have three big databases (one with users and setting, second and third with discussion data). I need to join data from first - second and first - third database, using JOINS etc.

I know, how to do this... but performance is a question... wil it be slower, than if I have all data in one database and doing JOINs (All dataabses are on same server, with same rights)

Martin Perry
  • 9,232
  • 8
  • 46
  • 114
  • 1
    add `index` to your fields [http://stackoverflow.com/questions/1108/how-does-database-indexing-work](http://stackoverflow.com/questions/1108/how-does-database-indexing-work) – Pragnesh Chauhan Nov 03 '12 at 11:21

2 Answers2

0

I would suggest writing the query using your current setup and then move all of the tables into one database, re-write the query and then see which one is the quickest.

Also, ensuring you have the correct and most efficient indexes setup on your columns is a must.

ajtrichards
  • 29,723
  • 13
  • 94
  • 101
0

I don't think you'll see performance difference. If you're concerned with performance, you should check the EXPLAIN output and make sure indexes are being used appropriately. You might also consider building your output page asynchronously. Load the main page, and AJAX in the discussion. The perception will be faster, even if overall it's a little slower.

http://dev.mysql.com/doc/refman/5.0/en/explain-output.html

Joshua Martell
  • 7,074
  • 2
  • 30
  • 37
  • Loadin time is not problem... bigger problem would be server-side CPU and memory load... thats what I am primary concern... indexes and everything else is now optimized, bud data are in one table only and duplicated in both DB, which is not quite good solution :) – Martin Perry Nov 03 '12 at 14:36