SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Should big tables with more cols be breaken into two tables?


Should big tables with more cols be breaken into two tables?

Author
Message
rajemessage 14195
rajemessage 14195
SSC Veteran
SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)

Group: General Forum Members
Points: 272 Visits: 348
To speed up my reports i am keeping reports specific data to reduce joins and
calulations, they are 50000 to 200000 rows in them.


but noticed that when i keep more number of cols my queriey gets slow
when compaired to less no of cols.

Q1) Is it correct ?
Then i checked 8060 and found that data in cols are less than 8060



Please tel me how should i see 8060, while making tables.

should i keep less no of cols and break my table.
so that only composite key will be repeated in two tables.


Q2) Not only this, i also noticed that queries which are fast they become slow after clearing buffer
, so i am trying them

To be fast even if they are not buffered ( so please tell me is this consideration is good).
can do some thing that every thing get buffered (because it is only reporting database)

yours sincerely.
Mark Eckeard
Mark Eckeard
SSC Veteran
SSC Veteran (257 reputation)SSC Veteran (257 reputation)SSC Veteran (257 reputation)SSC Veteran (257 reputation)SSC Veteran (257 reputation)SSC Veteran (257 reputation)SSC Veteran (257 reputation)SSC Veteran (257 reputation)

Group: General Forum Members
Points: 257 Visits: 505
Did you look at the execution plan on the query to see if there are any bottlenecks or possible improvements?

Do you have proper indexes on the tables based on your querying needs?

Also, it would help if you posted the table structure, sample data and the query.

Mark



Lynn Pettis
Lynn Pettis
SSC-Dedicated
SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)

Group: General Forum Members
Points: 38905 Visits: 38508
Mark Eckeard (12/6/2013)
Did you look at the execution plan on the query to see if there are any bottlenecks or possible improvements?

Do you have proper indexes on the tables based on your querying needs?

Also, it would help if you posted the table structure, sample data and the query.

Mark


I will also add that posting the actual execution plan(s), as .sqlplan file(s), would also be very useful.

Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
rajemessage 14195
rajemessage 14195
SSC Veteran
SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)

Group: General Forum Members
Points: 272 Visits: 348
yes i have cheked all possible things,
and finally came to conclusion that making one flat table would be good idea.

so all my queries are related to this flat table. and my question was related to having more cols in
one table or to have two tables with less cols is better or not.

selecting 50 cols out of 150 cols from a table is good or breaking the table into two and having 50 cols in one table and rest in other . and then selecting 50 cols from one table with joining.

i just want general behaviour of sql server in above situation , so that i can decide breaking it or not
with out making index, because i know that index will speed up and that option will be present even after breaking the
table. so that my queries can execute in zero second in database at least.

yours sincerly.
Mark Eckeard
Mark Eckeard
SSC Veteran
SSC Veteran (257 reputation)SSC Veteran (257 reputation)SSC Veteran (257 reputation)SSC Veteran (257 reputation)SSC Veteran (257 reputation)SSC Veteran (257 reputation)SSC Veteran (257 reputation)SSC Veteran (257 reputation)

Group: General Forum Members
Points: 257 Visits: 505
If your looking for a quick and easy way to get a fast query, sure, go with a flat table design. However, that doesn't exactly fit in to a *relational* database. For that much you could simply store your data in a text or xml file on the file system.

Instead of asking a generic question without any info, provide some details so we can help you the correct way. Post your table structures, query and execution plan and then we can help.

Mark



Sean Lange
Sean Lange
One Orange Chip
One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)

Group: General Forum Members
Points: 25807 Visits: 17509
As a general rule you should NOT design your tables based on how you expect to query the tables. You should design your tables to support the data. Then you design your queries and indexing structure to support how you get the data out.

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Modens splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search