A set of zero, one or more attributes, the value(s) of which are guaranteed to be unique for each tuple (row) in a relation.

learn more… | top users | synonyms

1
vote
2answers
50 views

Find duplicate rows violating unique constraint

Recently We meet a mysql error on slave, because a transaction can not be executed on slave. We found two records have the same unique in master, but inserted successfully. I have post two ...
1
vote
1answer
57 views

Can you enforce uniqueness in MySQL based on column in foreign table?

I am refactoring one of my database tables and I've come up with an issue. Specifically, I have a table with four columns. We'll call the first three my.a, my.b and my.c. I have a uniqueness ...
0
votes
1answer
52 views

MySQL Finding index size for compound unique indexes

I'm using following query to get index and data sizes for tables in database. But unfortunately it doesn't show index size for compound unique indexes. How can i get index sizes for compound unique ...
0
votes
1answer
46 views

auto_increment incremented on non-affecting queries

When performing the following query on 'sessions': INSERT IGNORE INTO sessions (user_id, archived) VALUES (3, 0) while: CREATE TABLE `sessions` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,...
0
votes
1answer
82 views

“key violation” when trying to import data into MS Access

I am trying to import data into an MS Access table from a flat ASCII file. I've done this many times before but now I am getting a "key violation." There is only one key in the table and it's an ...
2
votes
0answers
96 views

Unique Index much bigger than the table itself

Pg 9.3 on debian 7. I have a very huge table in rows, about 178 million (will turn 250 million in a week and then grow 500 thousand a day), but not that huge in size, wich is 20GB, it's a small ...
1
vote
0answers
21 views

Windows Azure Table Row Key strategy, what makes a useful RowKey?

I read somewhere that the row key should be useful - which is why auto numbers are not supported. However, for all 3 tables I've started saving I can't think of anything better to save in the row key ...
1
vote
0answers
70 views

Combining fields to make a unique record or keeping them separated

I've been asked to implement what has before, been a bunch of CSV files, into a MySQL database. I'm at a point in the design where all the schemas, tables and fields have been mocked-up; however I'm ...
1
vote
0answers
48 views

table scheme definiation it this way that insert duplicate into another table

I have a table in which there is a column name with SP varchar(10) NOT NULL. I want that column always to be unique so i created unique index on that column . My table schema as follows : CREATE ...
1
vote
0answers
285 views

mysql update unique values from 2 different tables based on 2 index fields

i have 2 tables with the same unique id. i want to change table1 unique_id sequence from (1-100) to random 8 digit ids (43342359 - 83083224) and cascade that to table2. what i have: - table1 id1 ...
1
vote
0answers
198 views

How can I force myisamchk to modify the original data file in case of duplicate keys?

In the documentation for myisamchk, it says: --quick, -q Achieve a faster repair by modifying only the index file, not the data file. You can specify this option twice to force myisamchk to ...
0
votes
0answers
17 views

find unique value from a list & sum & count their existing required value

1) I have a table named "plan_info_upload" which is like: site_id site_name 2G_bw 3G_bw route_path 1 MBCGP1 11 30 MBLMA1>MBSMGR 2 BOPBG2 12 22 ...
0
votes
0answers
34 views

Create a not unique FK in MySQL Workbench

I'm trying to model a database using MySQL Workbench (version 6.3.6, 64 bits, using linux mint). After syncing my model with a MariaDB (running in localhost, version 10.0.25), I discovered that the ...
0
votes
0answers
13 views

HA_ERR_FOUND_DUPP_KEY error after pt-OST optimize

I run a simple alter to optimize a table that had a lot of stale data using the pt-online-schema tool (wrapped for readability): pt-online-schema-change --alter='ENGINE=InnoDB;' --no-drop-old-table ...
0
votes
0answers
31 views

unique BIGINT as foreign key instead of primary key in distributed system

I am creating user management database schema. I am using Postgresql as database. Following is my approach. Please suggest if there is any performance issue if I use this structure. Requirement: ...
0
votes
0answers
47 views

SQLite table design for PK and/or UNIQUE

I'm trying to design a table in SQLite3, where I can perform these 2 actions. INSERT new row where a unique primary key is created. And INSERT new row with an given primary key Think of a ...