|
|
| Author |
Message |
| Phil. |
This post is not being displayed .
|
 Phil. World Chat Champion

Joined: 02 Feb 2002 Karma :     
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Frost |
This post is not being displayed .
|
 Frost World Chat Champion

Joined: 26 May 2004 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Jayy |
This post is not being displayed .
|
 Jayy Mr. Ponzi
Joined: 08 Jun 2009 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| ajag |
This post is not being displayed .
|
 ajag Brolly Dolly

Joined: 08 Aug 2010 Karma :     
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| panrider_uk |
This post is not being displayed .
|
 panrider_uk World Chat Champion

Joined: 23 Sep 2007 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| ajag |
This post is not being displayed .
|
 ajag Brolly Dolly

Joined: 08 Aug 2010 Karma :     
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| ajag |
This post is not being displayed .
|
 ajag Brolly Dolly

Joined: 08 Aug 2010 Karma :     
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Phil. |
This post is not being displayed .
|
 Phil. World Chat Champion

Joined: 02 Feb 2002 Karma :     
|
 Posted: 13:06 - 09 Nov 2010 Post subject: |
 |
|
Hi
I'm running PHP & MySQL.
Here's part of the cross database connection class
| Code: |
function link($site){
return @mysql_connect($this->sites[$site]['url'],$this->sites[$site]['db_user'],$this->sites[$site]['db_pass']);
}
function fetch_query($sql,$site){
@mysql_select_db($this->sites[$site]['db_table'],$this->link($site)) or die ("Unable to open database");
return @mysql_query($sql,$this->link($site));
mysql_close($this->link($site));
}
|
Using this I just select which site I want to access and run the query. One server holds a few sites which runs fine, it's the other servers which slow it down. |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| ajag |
This post is not being displayed .
|
 ajag Brolly Dolly

Joined: 08 Aug 2010 Karma :     
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Kai.Wilson |
This post is not being displayed .
|
 Kai.Wilson Spanner Monkey
Joined: 26 Sep 2009 Karma :     
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| TQ |
This post is not being displayed .
|
 TQ Trackday Trickster
Joined: 17 Dec 2009 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Frost |
This post is not being displayed .
|
 Frost World Chat Champion

Joined: 26 May 2004 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Phil. |
This post is not being displayed .
|
 Phil. World Chat Champion

Joined: 02 Feb 2002 Karma :     
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Kickstart |
This post is not being displayed .
|
 Kickstart The Oracle

Joined: 04 Feb 2002 Karma :     
|
 Posted: 17:01 - 10 Nov 2010 Post subject: |
 |
|
Hi
Views in MySQL are just for convenience. They have no performance benefits.
While keeping it in an SQL query will give the best performance, if you need multiple queries on the same database to get a final amount of info (which would suggest a poor database design, but sometimes necessary) then it might be best to have a php script running on the other database servers to do the intermediate processing, and only return the final info required.
All the best
Keith ____________________ Traxpics, track day and racing photographs - Bimota Forum - Bike performance / thrust graphs for choosing gearing |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Frost |
This post is not being displayed .
|
 Frost World Chat Champion

Joined: 26 May 2004 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
Old Thread Alert!
The last post was made 15 years, 307 days ago. Instead of replying here, would creating a new thread be more useful? |
 |
|
|