Hi!

On Mon, Dec 1, 2008 at 9:54 PM, Brian Aker <[EMAIL PROTECTED]> wrote:
> Hi!
>
> It crosses my mind several times a day that if we required primary keys on
> tables that replication with be far less of a hack (and work quite a bit
> better). Why? Because we could then target update/delete on other machines
> with primary keys and just execute directly on those keys.
>
> Without primary keys? You have to map the rows and do a LIMIT 1 on the
> queries. Really slow...


Maybe I'm off by a mile but I'll give it a go.

If I understand correctly, you are saying that if you would be sure
that you can always identify a single row in any table, replication
would be much simpler. Although I agree that a PRIMARY KEY would
satisfy that condition, I feel I should point out that a PRIMARY KEY
is a logical construct whereas all you really need is some physical
way to identify a row. So, if some kind of engine is known to have
some device that always allows physical identification (which may or
may not be accessible to the end-user from the SQL layer), then you
could go by that device, regardless of the existence of a PRIMARY KEY
in the logical model.

I am not saying this just to nitpick - If an engine has such a
built-in row-identifier it may be more efficient than the logical
primary key (especially if that happens to be a natural key).

So, my proposal would be to allow engines to advertise any internal
row-identifiers (and probably, the methods to look up a row using such
an identifier) that they may maintain to the API (should this be a
suitable key for replication). Of course, you can still demand that a
logical primary key be present in case an engine does not support such
a feature.

regards,

Roland

>
> Cheers,
>        -Brian
>
> --
> _______________________________________________________
> Brian "Krow" Aker, brian at tangent.org
> Seattle, Washington
> http://krow.net/                     <-- Me
> http://tangent.org/                <-- Software
> _______________________________________________________
> You can't grep a dead tree.
>
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~drizzle-discuss
> Post to     : [email protected]
> Unsubscribe : https://launchpad.net/~drizzle-discuss
> More help   : https://help.launchpad.net/ListHelp
>



-- 
Roland Bouman
http://rpbouman.blogspot.com/

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to