So far, I have never chosen to use GUIDs as Autonumer keys for the tables in
my projects, but a recent experience has got me to wondering.
I have recently been working on a system that, during the early testing
phases, has a fairly extensive schema, fairly few records, and quite a bit of
UI code to handle things that don't work well via bound forms.
In this application, I have repeatedly had bugs initially go undetected
involving the use of the wrong field because it just happened to have a value
of something like 1 or 2 that just happened to be the right value in the
testing context. It seems to me that this situation could be greatly improved
by using GUIDs, and I'm wondering what the experience of others here has been
regarding the use of Longs vs GUIDs.
As I'm typing this, I realize there's another option that would help which is
using Random rather than Increment for the New Values argument (a less redical
option?), so I guess the question is - Increment, Random, or Replication ID.
Opinions? 8 2417
Steve Jorgensen <no****@nospam. nospam> wrote in
news:16******** *************** *********@4ax.c om: So far, I have never chosen to use GUIDs as Autonumer keys for the tables in my projects, but a recent experience has got me to wondering.
Don't: http://trigeminal.com/usenet/usenet011.asp?1033
That specifically considers the use of GUIDs in replication (about
the only place where it theoretically makes sense), but all but one
of the pitfalls MichKa describes (#1) apply to non-replicated apps.
I have recently been working on a system that, during the early testing phases, has a fairly extensive schema, fairly few records, and quite a bit of UI code to handle things that don't work well via bound forms.
In this application, I have repeatedly had bugs initially go undetected involving the use of the wrong field because it just happened to have a value of something like 1 or 2 that just happened to be the right value in the testing context. It seems to me that this situation could be greatly improved by using GUIDs, and I'm wondering what the experience of others here has been regarding the use of Longs vs GUIDs.
VBA vs. ADO vs. DAO -- all three handle them differently.
As I'm typing this, I realize there's another option that would help which is using Random rather than Increment for the New Values argument (a less redical option?), so I guess the question is - Increment, Random, or Replication ID.
Don't use ReplicationID in a non-replicated context. Even in a
replicated app, don't use them, because of MichKa's warnings.
As to random, I don't quite see why it matters if they are random or
not. Random AutoNumbers seem to me to have only two uses:
1. in a replicated app insures that the chances of PK collision
between replicas is minuscule (I've never seen a collision).
2. distributes the values in a PK index uniformly over the entire
range of possible values and not sequentially. This could
conceivably be a performance enhancer, as new values will not all be
on the same index data page.
But GUIDs are not usable.
--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
> 1. in a replicated app insures that the chances of PK collision between replicas is minuscule (I've never seen a collision).
If you're working with small enough datasets to fit into memory, you
can generate random numbers yourself, without needing to be connected
to the database. ( Can be very useful for sales support. ) You can
also generate negative sequential numbers and then let the db reassign
them, but this can be difficult with lots of relational tables.
2. distributes the values in a PK index uniformly over the entire range of possible values and not sequentially. This could conceivably be a performance enhancer, as new values will not all be on the same index data page.
Interesting - I didn't think of that. They can be either useful for
security or a huge pain in the butt, in that they hide the order you
put records into your tables.
But GUIDs are not usable.
Totally agree.
On Thu, 18 Nov 2004 17:24:59 GMT, "David W. Fenton"
<dX********@bwa y.net.invalid> wrote: Steve Jorgensen <no****@nospam. nospam> wrote in news:16******* *************** **********@4ax. com:
So far, I have never chosen to use GUIDs as Autonumer keys for the tables in my projects, but a recent experience has got me to wondering. Don't:
http://trigeminal.com/usenet/usenet011.asp?1033
Very convincing - I'm convinced. It sounds like the idea is that you never
want to use GUIDs except for the unusual cases in which you still never want
to use GUIDs <g>, though Access may use them for you with replication, right?
... In this application, I have repeatedly had bugs initially go undetected involving the use of the wrong field because it just happened to have a value of something like 1 or 2 that just happened to be the right value in the testing context. It seems to me that this situation could be greatly improved by using GUIDs, and I'm wondering what the experience of others here has been regarding the use of Longs vs GUIDs.
VBA vs. ADO vs. DAO -- all three handle them differently.
As I'm typing this, I realize there's another option that would help which is using Random rather than Increment for the New Values argument (a less redical option?), so I guess the question is - Increment, Random, or Replication ID.
.... As to random, I don't quite see why it matters if they are random or not. Random AutoNumbers seem to me to have only two uses:
1. in a replicated app insures that the chances of PK collision between replicas is minuscule (I've never seen a collision).
2. distributes the values in a PK index uniformly over the entire range of possible values and not sequentially. This could conceivably be a performance enhancer, as new values will not all be on the same index data page.
But GUIDs are not usable.
Well, it matters for the reason I stated. I want the code to break the first
time I try to use a value from the same column, not accidentally work in early
testing because the id value happens to be something like 1 or 2, then fail
later when it's harder to track down. It seems like random Autoincrments
would be a big help for that.
On Fri, 19 Nov 2004 04:32:43 GMT, Steve Jorgensen
<no****@nospam. nospam> wrote: Well, it matters for the reason I stated. I want the code to break the first time I try to use a value from the same column, not accidentally work in early testing because the id value happens to be something like 1 or 2, then fail later when it's harder to track down. It seems like random Autoincrments would be a big help for that.
Hi
I'm sure that random autonumbers are exactly what you want in the
present case, but in some cases the idea of unique ids is very
appealling. The easiest way is to use the components of a GUID-like
object as separate fields. The 1996 spec for guids is explained here: http://kruithof.xs4all.nl/guid-uuid-info.html
David
I made a confusing typo there. "the first time I try to use a value from the
same column" should say "the first time I try to use a value from the wrong
column".
On Fri, 19 Nov 2004 04:32:43 GMT, Steve Jorgensen <no****@nospam. nospam>
wrote: On Thu, 18 Nov 2004 17:24:59 GMT, "David W. Fenton" <dX********@bw ay.net.invalid> wrote:
Steve Jorgensen <no****@nospam. nospam> wrote in news:16****** *************** ***********@4ax .com:
So far, I have never chosen to use GUIDs as Autonumer keys for the tables in my projects, but a recent experience has got me to wondering.
Don't:
http://trigeminal.com/usenet/usenet011.asp?1033
Very convincing - I'm convinced. It sounds like the idea is that you never want to use GUIDs except for the unusual cases in which you still never want to use GUIDs <g>, though Access may use them for you with replication, right?
.. In this application, I have repeatedly had bugs initially go undetected involving the use of the wrong field because it just happened to have a value of something like 1 or 2 that just happened to be the right value in the testing context. It seems to me that this situation could be greatly improved by using GUIDs, and I'm wondering what the experience of others here has been regarding the use of Longs vs GUIDs.
VBA vs. ADO vs. DAO -- all three handle them differently.
As I'm typing this, I realize there's another option that would help which is using Random rather than Increment for the New Values argument (a less redical option?), so I guess the question is - Increment, Random, or Replication ID.
... As to random, I don't quite see why it matters if they are random or not. Random AutoNumbers seem to me to have only two uses:
1. in a replicated app insures that the chances of PK collision between replicas is minuscule (I've never seen a collision).
2. distributes the values in a PK index uniformly over the entire range of possible values and not sequentially. This could conceivably be a performance enhancer, as new values will not all be on the same index data page.
But GUIDs are not usable.
Well, it matters for the reason I stated. I want the code to break the first time I try to use a value from the same column, not accidentally work in early testing because the id value happens to be something like 1 or 2, then fail later when it's harder to track down. It seems like random Autoincrments would be a big help for that.
On 19 Nov 2004 03:48:14 -0600, d.************* **@blueyonder.c o.uk (David
Schofield) wrote: On Fri, 19 Nov 2004 04:32:43 GMT, Steve Jorgensen <no****@nospam .nospam> wrote: Well, it matters for the reason I stated. I want the code to break the first time I try to use a value from the same column, not accidentally work in early testing because the id value happens to be something like 1 or 2, then fail later when it's harder to track down. It seems like random Autoincrments would be a big help for that.
Hi I'm sure that random autonumbers are exactly what you want in the present case, but in some cases the idea of unique ids is very appealling. The easiest way is to use the components of a GUID-like object as separate fields. The 1996 spec for guids is explained here: http://kruithof.xs4all.nl/guid-uuid-info.html David
Thanks, I do get the distinction between the use of a GUID/UUID for
application purposes and the use of a GUID-typed field in a table. I've been
hoping to use UUIDs to identify entities across separate component
applications at some point, such as holding a reference to a Party entity in a
business application that was obtained from a separate contact management
application. Va************@ gmail.com (Forrest) wrote in
news:9d******** *************** ***@posting.goo gle.com: 1. in a replicated app insures that the chances of PK collision between replicas is minuscule (I've never seen a collision).
If you're working with small enough datasets to fit into memory, you can generate random numbers yourself, without needing to be connected to the database. ( Can be very useful for sales support. ) You can also generate negative sequential numbers and then let the db reassign them, but this can be difficult with lots of relational tables.
Such a method will be computationally more intensive than relying on
Jet's random AutoNumber because you're homegrown method will have to
check if the value already exists, whereas that's built into the Jet
random AutoNumber functionality.
And exactly what random number generator will you use? The VBA one? 2. distributes the values in a PK index uniformly over the entire range of possible values and not sequentially. This could conceivably be a performance enhancer, as new values will not all be on the same index data page.
Interesting - I didn't think of that. They can be either useful for security or a huge pain in the butt, in that they hide the order you put records into your tables.
If it's the PK, they shouldn't have any meaning at all.
--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Steve Jorgensen <no****@nospam. nospam> wrote in
news:i5******** *************** *********@4ax.c om: On Thu, 18 Nov 2004 17:24:59 GMT, "David W. Fenton" <dX********@bw ay.net.invalid> wrote:
Steve Jorgensen <no****@nospam. nospam> wrote in news:16****** *************** ***********@4ax .com:
So far, I have never chosen to use GUIDs as Autonumer keys for the tables in my projects, but a recent experience has got me to wondering.
Don't:
http://trigeminal.com/usenet/usenet011.asp?1033
Very convincing - I'm convinced. It sounds like the idea is that you never want to use GUIDs except for the unusual cases in which you still never want to use GUIDs <g>, though Access may use them for you with replication, right?
Jet uses them behind the scenes for identifying replication objects.
But it never gets to the UI level and you never have to deal with
tme in code.
Though I guess you could if you *wanted* to -- but I can't think of
a reason why you'd want to, except if you had a case where
replication had been broken and you had to do the synchronization
"manually." I've done it, actually, but I didn't write any code for
GUIDs. I did use them as criteria in queries (in place of joins
between GUID fields, which are not supported in the QBE UI; dunno if
they are supported in Jet SQL, though -- never tried it).
--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Sniffle |
last post by:
Thanks...
Say you have a double opt in mailing list, of which the subcriber list is
store in the db. Im still somewhat of a newb, so bear with me... are there
any pros/cons as to keeping the 'unverified' subscribers in a different
table, aside from organization?
I did just that, where, when they subscribe, they are put in a temp table,
and them moved to the real table once verified (and the temp entry deleted).
At the time, I did this...
|
by: Steve |
last post by:
We've recently got a new Server in.
The server has 16Gb of RAM, 8 cpus etc
We now have a choice of sticking with Windows 2000 Advanced Server or
going with Windows 2003 Enterprise edition.
Besides being able to use more RAM and having to use Service pack 3a
in Win 2003
Any pros/cons of both ?
Any recommendations ?
|
by: Andy |
last post by:
Hi All!
We are doing new development for SQL Server 2000 and also moving from
SQL 7.0 to SQL Server 2000.
What are cons and pros for using IDENTITY property as PK in SQL SERVER
2000?
Please, share your experience in using IDENTITY as PK .
|
by: Fred |
last post by:
Not much expertise on XSLT and trying to understand it's uses when creating
apps in VS.NET?
If I wanted flexibility on the UI (View aspect of M.V.C.):
- How does it compare with creating business components that can be consumed
by WebForms, WinForms, mobile devices, etc? Is it even fair to compare the
such technologies?
- How about for cases when you need to display dynamic elements on the
form/grid (as compared to knowing data elements...
|
by: Steve |
last post by:
How do you rewrite the swap function without using a tmp variable in
the swap function????
int main()
{
int x = 3;
int y = 5;
// Passing by reference
| |
by: scott |
last post by:
Hi,
Just wondering what sort of problems and advantages people have found using
stored procedures. I have an app developed in VB6 & VB.NET and our
developers are starting to re-write some of the code in stored procedures
(im advocating encryption of them). When deploying an application however
stored procedure seem to add another level of complexity to installation. In
future we also plan to have an basic ASP app with some of the...
|
by: typingcat |
last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so
on. I've tried many PHP IDEs today, but almost non of them supported
Unicode (UTF-8) file.
I've found that the only Unicode support IDEs are DreamWeaver 8 and
Zend PHP Studio.
DreamWeaver provides full support for Unicode. However, DreamWeaver is
a web editor rather than a PHP IDE. It only supports basic IntelliSense
(or code completion) and doesn't have anything...
|
by: zahy[dot]bnaya[At]gmail[dot]com |
last post by:
Hi all,
Since I am always confusing this, I want to know once and for all what
is the right way of doing this.
I've noticed that some programs use:
std::cout<< "yadayada"<<endl;
|
by: Angus |
last post by:
Hello
We have a lot of C++ code. And we need to now create a library which
can be used from C and C++. Given that we have a lot of C++ code
using classes how can we 'hide' the fact that it is C++ from C
compilers?
Can we have a C header file which uses the functionality of the C++
files and compile this into a lib file?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |