From: Mitra <mi...@ea...> - 2003-02-14 22:37:33
|
Your proposal would make sense, except that I'd like to be able to re-import the same site later, along with any new views created. Since this (like just about any real case) is a multi-slice situation, its much more complicated than the auto-increment solution will allow for. I spent several days trying to fix and then extend the import code to handle views, but that was before I spotted the problem with short ids. At the moment I'm looking at either 1: Setting up a completely seperate apc-aa database for imports from this machine, and just copying the database 2: Abandoning hope of re-importing and doing a lot of emacs on the stuff when I move it. 3: Spending a bunch more days changing views to support names as well as vid= s. Unfortunately I need to spend some time building the sites, so don't have time to spend more energy trying to fix apc-aa ! - Mitra At 10:24 AM +0100 14/2/03, Marek Tichy wrote: >Hi Mitra, >yes this is a MySQL autoincrement behaviour. For any autoincrement >field, MySql keeps little pointer which contains the highest >value. This is being updated every time you INSERT/UPDATE the >record, regardles you specify the value for the autoincremented field >or not. >I don't think it's MySQL specific - I'd expect any SQL engine should >behave like this. > >I can't think about any easy solution for this. That's the pain of >merging autoincrements between two systems. BTW, maybe i should >mention it here because recently Honza told me that even he wasn't >aware of what was originally behind the decision to use long IDs. >It was: > >1) Every long ID is unique (in practice) >2) Some SQL databases don't have autoincrement (MySQL was one of >them when we started creating AA ). We wanted to keep the code >universal for any database system > >The 2 has already been broken for various other reasons and also >turned out not to be such an important issue (but may come back to >consideration again with the spread of AA). > >So - I also hate long IDs, especially packed ones, but there is >something about it. > >I'm not sure wheather I'm getting it righ but you seem to already >have some proposal for changing view IDs at the moment of >transfering them between two systems. So you must have sorted out >the problem of changing stuff like "cmd[383]" in all aliases >definitions, format strings and shtml pages. If you can do this, >than why don't you just count how many views you will need for the >import and than generate them as auotincrement, while keeping track >on what the new IDs are ? > >Best > Marek > > > > >> -----Original Message----- >> From: Mitra [mailto:mi...@ea...] >> Sent: 13. =FAnora 2003 22:56 >> To: Marek Tichy >> Subject: RE: [Apc-aa-coders] Inserting Views with out-of-sequence ids >> >> >> Sorry, lets see if I've understood you correctly, a typical example > > might be .... > > > > MySQL creates id's 1-10 for new records > > I add records specifically at 1001-1023 > > MySQL then creates the next id as 1024 > > > > Is that what you mean? >> >> That unfortunately is not very good behavior because part of the >> point of putting the added ids at 10001... >> is to get them out of the way of the auto-created ids. So that if a >> second import is done from the same slice they can safely overwrite >> using the same algorithm - e.g. adding 10,000 >> >> Is this APC-AA behavior, or something built into MySQL? >> >> - Mitra >> >> >> At 12:46 PM +0100 13/2/03, Marek Tichy wrote: >> >Hi, >> > >> >> As part of importing / exporting, I've got a problem with shortids. >> >> >> >> Lets take views for example - they have shortids which are an >> >> auto-increment field, >> >> >> >> When I import from one system to another, I want to add an offset to >> >> avoid clashes, for example I might add 1000 so that I can a) do it i= n >> >> emacs and b) understand the result and fix mistakes. >> >> >> >> Will this cause problems with the autoincrement field in any way? Fo= r >> >> example there might be views 1-10 and 1001 -1024, so will the next > > >> auto-incremented view by 11 ? And what happens when it >> > > auto-increments to 1000? >> > >> >It will always start from 1024. >> >> >> -- >> Mitra Technology Consulting - www.mitra.biz - mi...@mi... >> 02-6684-8096 or 0414-648-0722 >> >> Life is a Mystery to be Lived, not a Problem to be Solved >> > > > >------------------------------------------------------- >This SF.NET email is sponsored by: FREE SSL Guide from Thawte >are you planning your Web Server Security? Click here to get a FREE >Thawte SSL guide and find the answers to all your SSL security issues. >http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en >_______________________________________________ >Apc-aa-coders mailing list >Apc...@li... >https://lists.sourceforge.net/lists/listinfo/apc-aa-coders -- Mitra Technology Consulting - www.mitra.biz - mi...@mi... 02-6684-8096 or 0414-648-0722 Life is a Mystery to be Lived, not a Problem to be Solved |