Click here to get back home

database efficiency problem

 HomeNewsGroups | Search | About
 mailing.database.mysql    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
database efficiency problem TWIOF 09-01-2006
Get Chitika Premium
Posted by TWIOF on September 1, 2006, 7:31 am
Please log in for more thread options
HI,

i have a set of tables reffering to various aspects of a nigh-life
listings system.

I have tables named gigs and venues. Each gig has a venue.

So when displaying the data on the site people might search for a
specific gig and then see what venue it is heled at and want to see
what other gigs are heled there. Pretty simple.

My problem is. When calling the venue info to the gig page I seem to
have three options and can't decide whch is most efficient (especially
as allot of users may be searching at once).:

1) TWO queries one to the gig table retreiving all data, then one to
the venue table using the venue_id in gigs to find the relevant venue
id (PK) data.

2) same as above but using a JOIN

3) ONE query, but using the venues name as the PK, then i could simply
disply the name straight out of the gigs table, and then pass this
allong to the view venues page. I know it's data replication, but are
fewer queries more eficient?

what do you all think?


Posted by Aggro on September 1, 2006, 2:17 pm
Please log in for more thread options
TWIOF wrote:

> 1) TWO queries one to the gig table retreiving all data, then one to
> the venue table using the venue_id in gigs to find the relevant venue
> id (PK) data.
>
> 2) same as above but using a JOIN
>
> 3) ONE query, but using the venues name as the PK, then i could simply
> disply the name straight out of the gigs table, and then pass this
> allong to the view venues page. I know it's data replication, but are
> fewer queries more eficient?
>
> what do you all think?

3. is propably most efficient, but I recommend using the 2. because 3.
isn't good practice and can cause othe problems. The 2. should be
efficient enough for your needs if you just have proper indexes.

Similar ThreadsPosted
Correctness/efficiency of some sql statements July 14, 2005, 3:38 am
Table structure and query efficiency October 19, 2006, 4:11 am
Problem with MySQL Big Database October 27, 2005, 5:49 am
Problem with import of database in mysql July 25, 2005, 6:33 am
Database statistics / cardinality - NULL problem September 29, 2005, 3:15 pm
Slow MySQL Database - Restart Fixes Problem August 3, 2005, 11:16 am
converting ms access database to mysql 5 database March 13, 2006, 5:33 pm
Two way syncronizing with a website database with a local database February 4, 2007, 4:34 pm
how to convert .dbf database to mysql database May 13, 2007, 7:09 am
I need to move column field values from one database table to another database table January 27, 2006, 1:15 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap