One table or two tables with a join?

One table or two tables with a join?

I have 117 columns in a table, with a total column length of 1290. All of my queries against this table (4) work extremely fast because there are no joins.

However, 69 of the fields are tinyint fields that are only used (in the where clause) by one of the queries about 25% of the time.

Question: Should I move the 69 fields to another table and do a query with a join (just for that query)... or since it is only 69 tinyint, does it really make a difference? Having it in one table is easier.

I'm just afraid of the total length of the columns (1290) and total fields (117) in this table and how it might get slow later if everything is in one table... and I could move the 69 to another table.

Design decisions like this drive me crazy, because I consider myself a 'programmer' not a designer.


    Requires Free Membership to View

    By submitting your registration information to SearchOracle.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchOracle.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

You'll be fine as long as you don't have more than a few million rows.

If any of your queries search on a column, i.e. use a column in a WHERE clause, then you should consider an index on that column.

For More Information


This was first published in September 2003

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.