Select to view content in your preferred language

GUID AND GEODATABASE

690
3
02-11-2013 09:32 AM
AlesgerMammedov1
Deactivated User
Good day.

I have some questions for you.

First i want to know,  what do you think about GIUD ?

Second. Can you use GUID as primary key, when you were designing geodatabase ?

Third. Is the GUID best than ObjectID.

Biliev mr, it is very important for me.
0 Kudos
3 Replies
VinceAngelo
Esri Esteemed Contributor
Asking an opinion of GUIDs is like asking an opinion of 4-byte integers -- context is
everything, and you haven't provided one.

I wouldn't recommend using primary keys at all in a geodatabase (or more properly,
leave it to the geodatabase to decide the key for registered tables).

The primary benefit of a UUID is that it's very unlikely to appear multiple times in a
database.  This makes the type useful for uniquely identifying rows outside the context
of tables, but that benefit comes at a cost -- a large storage footprint (16 bytes in
SQL-Server, 38 in the other ArcSDE-supporting databases), measurable generation
time, and it's randomly ordered (causing index [and possibly table] fragmentation
on insert).

A registered rowid column (objectid) is a 4-byte integer; compared to GUIDs, it will
be faster, smaller, and won't fragement your tables and indexes on sequential insert.

Then again, if the tables are small (under 50,000 rows) none of the differences really
matter.

- V
0 Kudos
AlesgerMammedov1
Deactivated User
Thank you very much for your ansver.

But i don't undertand, what does it mean --> wouldn't recommend using primary keys at all in a geodatabase

For example if i will create geodatabase for emergency cituation, which primary key do you recommend me ?

And i exactly know, that table will be store more 50 000 rows.
0 Kudos
VinceAngelo
Esri Esteemed Contributor
Primary keys have costs associated with them.  I haven't seen a situation
where the benefits of using a primary key outweighed the costs.

Since GUIDs are random in nature, it would be foolish to organize a table
(clustered index) on GUID -- this would assure worst possible drawing
performance (spatial fragmentation).

- V
0 Kudos