Re: [Q] fragmentation and rowids
Posted in 1997
Chree Haas <haas@spiker.dfw.net> wrote:
> > Hey all,
> > I've just started working with fragmentation under ODS 7.13.
> > Everything works fine until I go into isql, v 6.03. Querying using
> > forms yields errors about rowid's being nonexistent. Is there any
> > way to bring this tool back to life, other than adding a rowid column?
Andrew Mercer responded:
> I haven't used isql, but from what I understand about table fragmention,
> each table fragment has it own rowids, and therefore rowid is no longer
> unique. To explain, if your table is fragmented over three dbspaces, then
> you will have three rowids of 1, three rowids of 2 and so on.
>
> This may be causing isql some problem. This is the reason we haven't
> started using table fragmentation yet - the application uses rowid. What I
> plan on doing is renaming the tables I am going to fragment, then create a
> view of that table with the origanal name. Then when the application
> queries the table, it will be accessing the data from the view which will
> have unique rowids.
>
> Any comments on this approach would be appreciated.
Andrew,
You don't have to go near that extreme! You can have unique rowid's
even in a fragmented table. On your current fragmented table, you can
run the following command:
alter table your_table add rowidsYour applications that use rowid, including isql, should now work.
Note 1: The rowid you've just added is now a physical column named
rowid.
It's data type is integer. It will not be the 2-part page/slot
number we have come to know and love. It also will not get your
data
as quickly as a true rowid would have. But your apps can run as
quickly as they could with any other integer index.
Note 2: I just gave up trying to figure out how your solution of
renaming a
fragmented table to the original table name will produce unique
2-part rowid's of the old type. Did you plan on creating
several
tables and creating a view on their union? (This has not worked
for
me yet.)
--
-- Jake (Lost in thought and won't ask for directions)
. .
_..-'( )`-.._
./'. '||\\\\. }\\_/{ .//||` .`\\.
./'.|'.'||||\\\\|.. )o o( ..|//||||`.`|.`\\.
./'..|'.|| |||||\\`````` \\,@,/ ''''''/||||| ||.`|..`\\.
./'.||'.|||| ||||||||||||. ||| .|||||||||||| ||||.`||.`\\.
/'|||'.|||||| ||||||||||||{ | }|||||||||||| ||||||.`|||`\\
'.|||'.||||||| ||||||||||||{ | }|||||||||||| |||||||.`|||.`
'.||| ||||||||| |/' ``\\||`` | ''||/'' `\\| ||||||||| |||.`
|/' \\./' `\\./ \\!|\\ /|!/ \\./' `\\./ `\\|
V V V }' `\\ /' `{ V V V
\\ \\ \\ V / / /
+-----------------------------------------------------------+
| Impeccable Logic: A thought process which successfully |
| resists chicken bites |
+-----------------------------------------------------------+