Christopher Browne cbbrowne at ca.afilias.info
Wed Apr 25 13:38:05 PDT 2007
Pat Maddox wrote:
> On 4/25/07, Andrew Sullivan <ajs at crankycanuck.ca> wrote:
>> On Wed, Apr 25, 2007 at 11:53:53AM -0700, Andrew Hammond wrote:
>> > Can anyone provide an example of a situation where table id
>> ordering would
>> > actually matter? I can't think of any.
>>
>> I'm pretty sure that if you're trying to use inheritance, it's
>> critical.  I can't think of a case where it's otherwise a problem
>> either, but I also learned BASIC on a PET, and therefore naturally
>> number things sparsely :)
>
> Since I'm not using inheritance (and never will in this db) will I be
> fine with sequential table IDs?
>
I'd expect so.  I haven't found cases yet where I *have* cared about
table ID ordering, and that's after setting up replication on quite a
large number of clusters.

>"Most of the time, it isn't" implies that some of the time it is.

No, it *doesn't* imply that the order is known to matter.

What I meant when I wrote that is that "most of the time, there is *no*
significance whatsoever to the ordering of the tables."  And I had no
certainty of significance that I could attach to the remainder.

In a more or less mathematical sense, most of the time, table IDs are
not taken into *any* kind of consideration.  Most of the time, the slon
sits there applying SYNC events, and the queries that are used for that
do not order themselves based on table ID.  They are ordered based on
"action sequence" (there's a sequence that gives out an "action
sequence" value each time the logtrigger() function fires).  I can say,
with some authority, that SYNC events do not make any use of table ID
ordering.  So, for that "most of the time," table ID order forcibly
*can't* matter, because it is not even considered.

There are certain events that *consider* table ID ordering.  Notably,
SUBSCRIBE SET (when it does the initial COPY), and EXECUTE SCRIPT. 
These events do their work, table by table, in an order controlled by
the table IDs within the set.

It is a bit of an open question as to whether there is reason to expect
there to be any significance to whether one table is processed *before*
another, or *after.*  There might be some significance in the context of
a set of replicated tables that involve inheritance relationships,
although I haven't seen any evidence yet of any *known* significance,
even in that case.  I haven't been able to rule it out, which is why I
haven't been able to make any certain statement to the effect that "we
know that table ID ordering DOES NOT MATTER."

If someone's doing something bizarre enough, there may be some
interaction where it will matter.  I'd be plenty interested in hearing
about such a case; that should provide enough information to come up
with a more categorical statement about where it does and doesn't matter. 

Until then, it has to remain with just a little bit of uncertainty.  I
don't know if P=NP.  And I don't know for certain that table ID ordering
is of NO significance.


More information about the Slony1-general mailing list