Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Should big tables with more cols be breaken into two tables? Expand / Collapse
Author
Message
Posted Thursday, December 5, 2013 10:09 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, July 28, 2014 10:33 PM
Points: 47, Visits: 143
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.
Post #1520408
Posted Friday, December 6, 2013 5:31 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 5:24 AM
Points: 128, Visits: 490
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



Post #1520528
Posted Friday, December 6, 2013 8:47 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 11:56 AM
Points: 20,676, Visits: 32,268
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.



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)
Post #1520621
Posted Tuesday, December 10, 2013 5:59 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, July 28, 2014 10:33 PM
Points: 47, Visits: 143
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.
Post #1521480
Posted Tuesday, December 10, 2013 10:48 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 5:24 AM
Points: 128, Visits: 490
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



Post #1521600
Posted Tuesday, December 10, 2013 12:19 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 2:34 PM
Points: 12,923, Visits: 12,342
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 Moden's 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)
Post #1521640
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse