Unix Technical Forum

Myths

This is a discussion on Myths within the DB2 forums, part of the Database Server Software category; --> I am creating a new database. I have asked this question before, but not received a definite answer. Question: ...


Go Back   Unix Technical Forum > Database Server Software > DB2

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 03:28 AM
Stanley Sinclair
 
Posts: n/a
Default 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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 03:28 AM
Mark A
 
Posts: n/a
Default Re: Myths

"Stanley Sinclair" <stanleysinclair@bellsouth.net> wrote in message
news:1113776053.658218.140820@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.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 03:28 AM
Bob [IBM]
 
Posts: n/a
Default Re: Myths

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" <nobody@nowhere.com> wrote in message news:RJadnW-aAcyZdv_fRVn-2A@comcast.com...
> "Stanley Sinclair" <stanleysinclair@bellsouth.net> wrote in message
> news:1113776053.658218.140820@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.
>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:46 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com