Questions tagged [uuid]

A Universally Unique Identifier (UUID), GUID in Microsoft parlance.

Filter by
Sorted by
Tagged with
1
vote
1answer
50 views

best index type for uuid in postgres 11

I realize a similar question has been asked multiple times but all the ones I can find are from 2014/2015 and many versions of postgres ago. I'm on postgres 11. I'm introducing a new primary key for ...
0
votes
0answers
83 views

How to pass array of UUIDs *OR* empty array and return implicit (inner join)?

How would I pass a list that is either full of UUIDs or empty, then return only joined records with those id values or all records if empty? This question (Casting an array of texts to an array of ...
1
vote
1answer
324 views

Postgres support for UUID [closed]

My understanding is that Postgres supports UUID data type out-of-the-box. I'm running Postgres on Amazon RDS with Engine version 10.6 and am scratching my head as to why the following commands are not ...
1
vote
2answers
546 views

Clustered Sequential GUID Primary Key vs Non-Clustered GUID and Clustered Sequential ID Primary Keys

I'm trying to figure out what the optimal solution is in regards to size and performance when using GUIDs as a primary key. The main reason for wanting GUIDs is that it's more appropriate in our micro-...
3
votes
2answers
3k views

Casting an array of texts to an array of UUIDs

How can I cast an array of texts into an array of UUIDs? I need to do a join between two tables: users and projects. The users table has an array field named project_ids containing the project IDs ...
2
votes
1answer
958 views

How to fix issue uuid_generate_v1() does not exist in postgresql , actually i have the function under public schema

org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select * from da.test_get(cast(? as integer),cast(? as text),cast(? as text),cast(? as text),cast(? as text)...
1
vote
1answer
542 views

Are there any performance differences with a GUID vs INT clustered indexed column, especially with joins on those columns?

Basically what the title says: What are the differences in performance (if any) between using a clustered index on a GUID column vs a clustered index on an INT column, especially when those columns ...
0
votes
1answer
175 views

Primary key and index column for Merge replication- Id vs GUID

I currently am revising the tables structure for a few geographically distributed databases- all tables currently have a UUID that is set as primary key. Merge subscription is currently (and in the ...
1
vote
1answer
2k views

In Postgres, how to select by a column of type UUID [closed]

I have a DB table that someone else created, its PK is a single column of type 'uuid'. I'm struggling to perform a simple select by that column. Examples I have tried with no success: select from ...
1
vote
1answer
807 views

In Postgres 10, how do the choice of SERIAL or UUID type as primary key affect replication, if at all?

A popular answer on SO states that using UUIDs as primary keys has the following benefit: Makes replication trivial (as opposed to int's, which makes it REALLY hard) I have been unable to find ...
1
vote
1answer
421 views

Convert SID string to varbinary(85)

My ssrs server was moved to a different domain because of which the Users table need to be updated with new SID current sid: S-1-5-21-39949945-591092532-1226208319-1007 I want to convert this sid ...
5
votes
1answer
3k views

PostgreSQL two different ways to generate a UUID: gen_random_uuid vs uuid_generate_v4?

What is the difference between the following two functions gen_random_uuid() provided by pgcrypto extension uuid_generate_v4() provided by uuid-ossp extension Are they both the same behind the ...
-2
votes
1answer
61 views

Difference between UUID UUID + Id

what is the difference between these 2 solutions: UUID as primary key VS auto-increment ID as primary key + new UUID field
0
votes
1answer
707 views

mariadb Unknown system variable 'server_uuid'

Im trying to setup replication between mariadb(10.1.31-MariaDB - MASTER) and mysql(5.7.12-log - SLAVE). After executed the start slave, I got the below error. Fatal error: The slave I/O thread ...
0
votes
2answers
200 views

Index or View of all UUIDs in Postgres DB?

I have a Postgres database with about 35 tables of varying sizes. Every table has an auto incrementing integer primary key, as well as a native postgres uuid type v4 uuid. The application code logs ...
2
votes
2answers
1k views

Can IDENTITY COLUMNS generate UUIDs?

I'm just wondering if either the spec of the implementation (PostgreSQL) provides for generating identity columns from UUIds or the like. Is there an alternative to, CREATE TABLE f ( id uuid ...
7
votes
4answers
2k views

What can go wrong using the same sequence across multiple tables in postgres?

We are considering using a shared sequence to assign ids to primary keys for all of the tables in our database. There are about 100 of them. Only a couple are inserted to frequently and regularly. We ...
0
votes
2answers
266 views

UUID/GUID field and shards

I am planning on using UUID field for storing items which can have a parent item. I am using PostgreSQL 9.5. I imagine there will be 3-4 levels at most. The design is to hold a structure such as ...
-3
votes
1answer
396 views

I need to generate a GUID,help [closed]

I need help with an SSIS package, I need to generate a GUID code every time I register a row of data, can someone explain how it is done? In the SISS package, the data is extracted from an excel file,...
6
votes
1answer
13k views

PostgreSQL custom operator UUID to varchar

I have a rather complicated Postgres database in which many UUID fields were incorrect stored as VARCHAR. I'd like to migrate them over in piecemeal, but unfortunately, doing so breaks all my views as ...
3
votes
0answers
461 views

Which SQL Power Architect type to specify for [PostgreSQL] UUIDs/GUIDs in new column property template/UI?

I have inherited maintaining and extending SQL Power Architect projects in source control which are used to generate the DDL for project DB schemas. We are currently using PostgreSQL 9.5 and SQL Power ...
3
votes
1answer
844 views

`uuid_generate_v1mc` in Postgres “uuid-ossp” module: What is random multicast MAC address?

The uuid-ossp module extension (plugin) for Postgres offers this alternative method for generating a UUID value. uuid_generate_v1mc() This function generates a version 1 UUID but uses a random ...
7
votes
1answer
1k views

Does Postgres offer a feature like “NEWSEQUENTIALID” in MS SQL Server to make UUID as primary key more efficient

Microsoft SQL Server offers the NEWID command to generate a new GUID (the Microsoft version of UUID) value that can be used as a primary key value (in their uniqueidentifier data type). These are not ...
4
votes
1answer
653 views

May postgresql's uuid_generate_v1() conflict when we change the computer date/time?

According to postgresql uuid-ossp documentation uuid_generate_v1() is based on Mac address + timestamp: https://www.postgresql.org/docs/9.4/static/uuid-ossp.html On a distributed database scenario ...
0
votes
1answer
260 views

MySQL column that auto generates data, longer than UUID

My friend has the problem as shown below. He asked at StackOverFlow and there is no reply yet till now so I wish to help him to try the luck here. Thanks for everyone that helps. "I would like to ask ...
2
votes
1answer
2k views

GUID vs Auto Increment Insert performance

I'm testing the performance of inserts between Auto increment integers vs GUIDs (v4) in tables with a lot of data. Following this blog post, i was expecting seeing a difference. But right now with ...
1
vote
1answer
31 views

Fragmentation with PXC setup using an ordered UUID as PK

I am looking to implement a table which will accessable via a Percona XtraDB cluster of 3+ nodes. I am expecting it to grow at about 1mil rows per month and the data will be kept for about 2 years (...
-1
votes
1answer
139 views

Generating Record Ids in Postgres [closed]

Using the UUID data type with its 256 chars seems like overkill, while assigning an auto-increment int4 seems less robust. Is there a more robust way to assign a record id without using uuid or an ...
6
votes
1answer
14k views

How do I install/enable the uuid-ossp extension on Postgres 9.3?

I’m using Postgres 9.3 on Ubuntu Linux 14.04. How do I install/enable the uuid-ossp extension? I first verified the contrib package was installed … root@prodbox:/home/rails/myproject# apt-get ...
7
votes
2answers
9k views

How Uniqueidentifier in SQL Server is always a unique value globally?

As per microsoft documentation on UniqueIdentifier, This value is always a unique globally beacuse it's based on network clock and CPU clock time and on the other hand the same documentation says ...
9
votes
1answer
17k views

psql 9.5: gen_random_uuid() not working

SELECT gen_random_uuid() produces output ERROR: function gen_random_uuid() does not exist SQL state: 42883 Hint: No function matches the given name and argument types. You might need to add ...
1
vote
3answers
566 views

Is GUID(uniqueidentifier) not suitable for a clustered index? [closed]

When i use uniqueidentifier datatype for primary key column then it will automatically create clustered index... So, will it slow down my queries or not ? I am explaining some description of my ...
4
votes
1answer
6k views

Is it Ok to use GUID as the Foreign Key?

Here's my current situation: We have a table storing data submitted from the website form, say "MyTable". The table uses bigint (auto-increment) as the primary key. Everything is good so far. Now, ...
16
votes
2answers
7k views

What is the purpose of a Row_GUID column?

I've been digging around in the AdventureWorks2012 database and see Row_GUID used in several tables. There are 2 parts to my question: When should I include a Row_GUID column? What are the uses and ...
3
votes
0answers
6k views

Generate UUID v4 automatically in MySQL

Is it possible to generate a UUID version 4 (completely random) in MySQL? I would like to use it as a primary key. Use Case Many systems will insert to the table, some may specify a UUID when ...
1
vote
1answer
2k views

How to use sequential UUID primary key for range query by date

I'm using a sequential timebased GUID as my primary key in MySQL 5.6 in a transaction table with over 1 billion rows. The application is written in JAVA and GUID is generated as described here: http://...
1
vote
1answer
118 views

Started using UUID's as primary key, would like to execute union of entities with BigSerial Primary Key

Some of my newer tables are now using UUID type fields as PKey and older tables are still using bigserial. I have several tables (let's call them entities) I would like to query returning the primary ...
3
votes
1answer
1k views

PostgreSQL UUID Literal: ERROR: syntax error at or near

Whever I use a UUID as a literal, I get SELECT a82857b6-e336-4c6c-8499; ERROR: syntax error at or near "-" I thought it might be an encoding issue, but that doesn't seem to be it.
18
votes
2answers
8k views

Is there a penalty for using BINARY(16) instead of UNIQUEIDENTIFIER?

I've recently inherited a SQL Server database that uses BINARY(16) instead of UNIQUEIDENTIFIER to store Guids. It does this for everything including primary keys. Should I be concerned?
61
votes
2answers
65k views

Default value for UUID column in Postgres

In Postgres 9.x, for a column of type UUID, how do I specify a UUID to be generated automatically as a default value for any row insert?
17
votes
2answers
3k views

SQL Server UniqueIdentifier / GUID internal representation

A colleague of mine sent me an interesting question, that I can't entirely explain. He ran some code (included below) and got somewhat unexpected results from it. Essentially, when converting a ...
24
votes
2answers
13k views

How should I index a UUID in Postgres?

I'm new to PostgreSQL and somewhat new to databases in general. Is there an established way of how we should index UUID values in Postgres? I'm split between using hashing and using a trie, unless ...
2
votes
1answer
2k views

MySQL/InnoDB - Clustering Index with UUID

In MS SQL Server it is possible to cluster an index on a non-primary, non-unique key. For example, if I wanted to create a clustered index on the insert date to prevent page splits and fragmentation ...
0
votes
1answer
317 views

MySQL is pretty slow after 50-100k rows whats happen?

i have trying now a lots of time, and i try to find a way there make sense to find out of my problem, but this problem stil make a lot perfumes issues. i testing it of on a developer server ( 2 cores,...
6
votes
2answers
704 views

Guid vs. integer ID for unique fields

This is really a generic question. Suppose I have a replication pattern of a single write DB and multiple read DB replication slaves - I do not have to have GUID's as my unique IDs fields. Is that a ...
2
votes
0answers
131 views

ola hallengren Index Maintenance script - GUID Index

We been running ola hallengren Index Maintenance script and was ran into a problem with some indexes that have GUID as the Index Key, They are Frag and have a page count of 6,309, but they don’t get ...
6
votes
2answers
1k views

SQL Server: Create New GUID Values for Existing Index

I have an existing table with about 6 million rows. The relevant columns are: ID int not null PK Key uniqueidentifier not null Read/write on this table by Key lookup is probably something like 100 ...
2
votes
1answer
771 views

Almost sequential GUIDs vs random GUIDs?

I'm looking at using GUIDs (UUID) as primary key with clustered index in SQL Server. In my webb-app I have many clients who will create items client side in javascript and save them only now and then....
4
votes
2answers
268 views

removal of GUIDS used for all PK's, FKs & Clustered indexes

Inherited control over a database that has this nasty config. It also has large sections of code generated by NHibernate, including the gneeration of GUIDs before they get to the db so no chance of ...
1
vote
1answer
201 views

Can one part of a multi-column primary key be used across tables?

I want to use SQLite as file format for my app, a reporting program. Below is an idea of the kind of schema I'll use (just the first few tables). There will be one report per file and all tables ...