Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 30th, 2006, 07:49 AM
Authorized User
 
Join Date: Aug 2006
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ankur_icfai
Default Seek Time...

O Hi...Folks can anyone tell that does the number of columns in the database table effect the seek time...

if there are more columns in the table will it take more time to get a particular data from the table through a query.. compared to a table which has less columns:)

think smart,
Ankur Mishra.
India.
 
Old August 30th, 2006, 08:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Generally speaking, I think the answer is yes, but there are never simple answers ...

Access to columns within a row is pretty efficient. Fixed width columns are stored as offsets within the row; it doesn't take any longer to access bytes at offset 5312 than it does at offset 0. Variable length columns are stored a little differently, with an extra level of indirection, so access to them is generally a bit slower, no matter how many of them there are or where they are located.

The more columns there are in a row, the bigger the row is. This would mean that fewer rows would fit in a page, so more pages would be required to store the data, which means more page seeks would be required to satisfy any given query.

But this also holds true if there are just a lot of rows in a table, or if the few columns are very "fat" - there'll be more pages that way too.

I think you would be far better off worrying about whether your table structure is correctly modeling the entities it is supposed to represent. A poor table design will result in queries that will take far, far longer to execute than any miniscule advantage you might realize by having a table with 47 columns rather than 147. If 147 is what it takes to model your application data requirements, then that should be the number of columns in your table. Splitting up the table into arbitrary pieces because of some perceived performance improvement is really the wrong way to look at it. A requirement will inevitably pop up down the road which will require you to join those rows back together, and that JOIN operation, run once, will wipe out years' worth of the millisecond improvements you got by reducing the number of columns in a row to something less than the application data requirements demand.

IMO :D



Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old August 30th, 2006, 11:14 PM
Authorized User
 
Join Date: Aug 2006
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ankur_icfai
Default

O Hi,

     Thanks duo..for this information..

enjoy,

Ankur Mishra.





Similar Threads
Thread Thread Starter Forum Replies Last Post
seek a expression petergoodman XSLT 3 July 16th, 2008 01:45 AM
cannot 'seek' inside a function dextermagnific XSLT 2 August 10th, 2006 01:54 AM
How to use seek method in DAO nadee VB How-To 4 April 21st, 2006 10:55 AM
DAO and seek torro17 BOOK: Access 2003 VBA Programmer's Reference 1 March 15th, 2006 06:02 PM
Seek record in Access sunny76 Access 3 February 21st, 2006 09:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.