First let me start out by saying I have not looked at the Postgres source,
thus this is pure speculation until confirmed by someone who knows for sure.

If you store data in a btree type of format (which I believe is how Postgres
stores data, or at least indexes) and then you perform a full query with out
any sorting done, the output is geneally done by navigating the tree. Often
recursively.

As you add data to your tree, depending on how the tree is built, the shape
of the tree changes as it grows. Navigating the tree will generally result
in slightly different order of elements as well..

It could represented like this:

                                        1

                                2               3

So that a query will return 1-2-3 as it starts at the top, goes down the
left side, then down the right side. If the tree were to grow, such as this:

                                        1
                                2               3
                        4       5               6       7

Then the output might be 1-2-4-5-3-6-7.

Greg

Gregory S. Youngblood
ext 2164

-----Original Message-----
From: Darren Greer [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 12, 1999 12:48 PM
To: [EMAIL PROTECTED]
Subject: [ADMIN] Data out of alignment?


Hello all.

Often times in our database we have web pages built off of the order in
which data is retrieved from the database.  For the most part this data is
retreived in the same order in which it was put in.

For Example we put in the following info

song1, title2
song2, title2
song3, title3

Each row being a new record.  Now the oid given to these is obviously in the
same order in which they are written.  But what we see hapenning is that the
order in which these are retrieved is changing.  For example it would come
out:

song1, title1
song3, title3
song2, title2

If you were to order it by oid it would come out the way it was put in.

My question is, what would cause the data to come out differently all of a
sudden, as in it comes out the right way one day, and then off the next, and
the only thing that has been done, is that more data has been added to the
table.  Could that cause it to shift like that.  Normall we select this by
no order.  Is it safe to select it by the oid....as in the oid will NOT
change, even though the order in the database is shifting?

Thanks for any insight.

Darren


Reply via email to