HighDots Forums  

Multiple Database Queries: How big a performance hit?

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Multiple Database Queries: How big a performance hit? in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
DavidB
 
Posts: n/a

Default Multiple Database Queries: How big a performance hit? - 11-02-2005 , 06:46 PM






I'm displaying four categories of information from four tables in four
locations. It was hard to figure out how to do it all with one query, so
I made four separate queries. It works fine locally, but my online pages
load extremely slowly. I haven't yet figured out if the problem is with
my scripts or my online database. However, I wondered how much, if any,
it might speed things up if I combined queries.

These two queries are very similar...

$area_res = mysql_query("SELECT DISTINCT GWEA.NameEA FROM gwgeogeco
as GWEA
INNER JOIN gzecoregions AS GZER ON GZER.Place = GWEA.IDArea
WHERE GZER.Animal = '$_GET[$MyGet]' LIMIT 10");

$Biome = mysql_query("SELECT Biome FROM gwgeogeco as GWEA
INNER JOIN gzecoregions AS GZER ON GZER.Place = GWEA.IDArea
WHERE GZER.Animal = '$_GET[$MyGet]' GROUP BY Biome");

Table gzecoregions is huge, with about 350,000 rows, though just three
fields. I think gzecoregions has less than 1,000 rows. The other two
queries involve the same tables but inner join on one or two additional
tables.

Anyway, do you think combining queries would make much difference in
performance?

Thanks.

Reply With Quote
  #2  
Old   
SterlingDK
 
Posts: n/a

Default Re: Multiple Database Queries: How big a performancehit? - 11-03-2005 , 09:37 AM






you could use stored procedures - if you are using mysql 5.

also, you could look into data caching. Not sure how to do this in php, but if you are using asp.net its pretty simple stuff.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.