You are here:  » Table Joins

Support Forum



Table Joins

Submitted by Keeop on Tue, 2011-01-04 16:14 in

Hi David,

Happy New Year!

Wondering if you could impart some of your wisdom please?

My 'products' table is gradually expanding as I'm trying to assign more data to each product. I'm now wondering, though, which would be quicker. Keeping a lot of data in the 'products' table and just calling the one query to select from the 'products' table, for use in searches, product, price displays etc., or to use a separate table to hold this extra info and create an INNER JOIN to that table from my query? Your advice would be appreciated!

Cheers.
Keeop

Submitted by support on Tue, 2011-01-04 16:31

Hi Keeop,

If there's no requirement for the additional fields to be indexed I don't think there's anything to be gained by using a separate table - it won't affect query performance (as that is done against the index), and will save you having to make a separate query afterwards to pick-up additional data - so overall that would probably be slower...

Cheers,
David.
--
PriceTapestry.com

Submitted by Keeop on Wed, 2011-01-05 11:12

Hi David,

Thanks. So, if I wanted to index the extra data, it would be worth putting it in a new table then, otherwise, leave as-is?

Cheers.
Keeop

Submitted by support on Wed, 2011-01-05 11:20

Hi Keeop,

I would still be inclined to keep the data within the same table. Even if you do index additional fields that's fine as long as (with any indexed query) you keep to just one WHERE clause; and then you're still saving any overhead of having to requery afterwards...

Cheers,
David.
--
PriceTapestry.com