Subject | Re: [firebird-support] Field Position - Does it matter? |
---|---|
Author | Ann W. Harrison |
Post date | 2005-03-25T17:12:09Z |
Larry Hengen wrote:
independent. There's no particular reason - other than history - that
fields are stored in the order they're declared. One of the attributes
of a field is position. That attribute determines where the field shows
up in a "select * from <table>". At some point, as we get into making
changes to the ODS (on disk structure - the physical representation of
the database) we may store fields ordered by type and size for better
compression.
contiguous. Indexes are stored on their own pages, entirely separate
from data.
subject) programmers who use select * or insert without a field list,
the position matters a lot - if you forget it (or change it, or add a
field) your code stops working. If you're a forward thinking,
professional programmer (see above), the order doesn't matter at all.
Ann
>Not at all. The order of declaration and the "apparent" order are
> Does it matter what position in the table definition a foreignkey or
> varchar appears?
independent. There's no particular reason - other than history - that
fields are stored in the order they're declared. One of the attributes
of a field is position. That attribute determines where the field shows
up in a "select * from <table>". At some point, as we get into making
changes to the ODS (on disk structure - the physical representation of
the database) we may store fields ordered by type and size for better
compression.
>None. Neither does it matter if the fields in a compound key are
> For instance, if a varchar appears before a FK, and the varchar gets
> updated, what affect does that have on the indexes?
contiguous. Indexes are stored on their own pages, entirely separate
from data.
>If you're one of the lazy undisciplined (not that I have opinions on the
> Does column order matter at all?
subject) programmers who use select * or insert without a field list,
the position matters a lot - if you forget it (or change it, or add a
field) your code stops working. If you're a forward thinking,
professional programmer (see above), the order doesn't matter at all.
>Regards,
>
Ann