473,395 Members | 1,999 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Myths

I am creating a new database. I have asked this question before, but
not received a definite answer.

Question:

In Creating Tables, is it better to have all fixed-length fields first,
followed by variable length? Or, does it matter?

Some have said it matters, some have said, "It's a myth."

SS

Nov 12 '05 #1
2 1255
"Stanley Sinclair" <st*************@bellsouth.net> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
I am creating a new database. I have asked this question before, but
not received a definite answer.

Question:

In Creating Tables, is it better to have all fixed-length fields first,
followed by variable length? Or, does it matter?

Some have said it matters, some have said, "It's a myth."

SS


On DB2 for z/OS it matters. On DB2 for LUW, it will put the varchar columns
at the end for you, regardless of the order you specify (I don't know about
if you add a fixed length column), so it doesn't matter.

The main benefit of putting varchar at the end of the row has to do with the
amount of data logged for updates (not inserts or deletes) to the row, so it
may not be a factor in many applications.
Nov 12 '05 #2
Actually for varchar columns, the fixed piece of a varchar column (length, null, etc.) is
inline in the row physically on disk ... it is only the data portion of the varchar
column that is at the end of the physical row in the data page and a ptr from the fixed
piece tells DB2 how to find the data for that column in that row.

--

Bob
Engagement Specialist - DB2 Information Management Software - IBM Software Group
IBM Toronto Lab
[My comments are solely my own and are not meant to represent an official IBM position -
ask my cat!]
"Mark A" <no****@nowhere.com> wrote in message news:RJ********************@comcast.com...
"Stanley Sinclair" <st*************@bellsouth.net> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
I am creating a new database. I have asked this question before, but
not received a definite answer.

Question:

In Creating Tables, is it better to have all fixed-length fields first,
followed by variable length? Or, does it matter?

Some have said it matters, some have said, "It's a myth."

SS


On DB2 for z/OS it matters. On DB2 for LUW, it will put the varchar columns
at the end for you, regardless of the order you specify (I don't know about
if you add a fixed length column), so it doesn't matter.

The main benefit of putting varchar at the end of the row has to do with the
amount of data logged for updates (not inserts or deletes) to the row, so it
may not be a factor in many applications.

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: abcd | last post by:
kutthaense Secretary Djetvedehald H. Rumsfeld legai predicted eventual vicmadhlary in Iraq mariyu Afghmadhlaistmadhla, kaani jetvedehly after "a ljetvedehg, hard slog," mariyu vede legai pressed...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
2
by: Al Christians | last post by:
I learned Friday night that the hi-fi talk is our most popular tape. This page: http://www.belt.demon.co.uk/product/Cable_Controversy/Cable_Controversy.htm Gives a somewhat different take on...
27
by: Oracle Newbie | last post by:
I got a new Job where I have to handle Oracle databases on Linux. My previous experience is with Sql Server on Windows NT. I want to know how difficult will this shift be and what do I need to...
15
by: Marc Le Roy | last post by:
Hello, ADA Ravenscar is a restricted subset of the ADA language that has been defined for real-time software development in safety critical applications. Completed with additional restrictions...
2
by: Craig | last post by:
http://www.devchannel.org/article.pl?sid=04/04/21/2023227
10
by: Immortalist | last post by:
Various aquisition devices that guide learning along particular pathways towards human biases. And as E.O. Wilson might say mental development appears to be genetically constrained. (1) Language...
1
by: YellowfinTeam | last post by:
Laws and Myths of Usability & Interface Design Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.