All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
1answer
32 views

ENUM column auto set

I have two tables "using" foreign keys: Referencing table CREATE TABLE `requests` ( `request_id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, -- `status` enum('new','...
0
votes
0answers
213 views

Is there any performance benefit of using ENUM instead of TinyInt in big data for MySQL?

I read a lot of articles about ENUM. but most of them are comparing ENUM to joins not tinyint. I need fields with 2-5 different statuses. In this situation is there any performance or storage benefit ...
2
votes
1answer
1k views

How does MariaDB handle ENUM types used in FOREIGN KEY constraints?

Off the heels of this question, How does MySQL handle joins on ENUMs? How does MySQL work if the referencing table has more and less values in the ENUM than the table being referenced? Is it ...
1
vote
1answer
236 views

How does MariaDB handle joins on ENUMs?

I'm just wondering because MySQL ENUMs are essentially tied to the table, how do they handle JOINs if two tables have the same ENUM? Are they join based on the ENUM value's or the string-key (input)? ...
1
vote
3answers
799 views

One-to-many dictionary (lookup) table vs varchar vs enum?

Imagine we have orders table, and an order has a status. Which of these three options is the best? Use varchar for status column Use enum for status column Use separate status table, which has ...
0
votes
0answers
300 views

Mysql: enum part of unique Index

Is it possible to have an unique index on multiple columns, of which a column with type enum is part of? Let's say I have 3 columns, which are an unique index, combined: date type companyId date ...
1
vote
1answer
388 views

Can I alter ENUM value from lowercase to studlyCase without reindex?

I have a several big tables, and enum in each of them (example): ENUM ('webmasters', 'stackexchange', 'stackoverflow') Documenation says, that return value is in lettercase of ENUM definition, so I ...
3
votes
0answers
802 views

Supertype table with disjoint subtypes in MySQL

I want to have base parent table with few disjoint subtypes. To illustrate what I mean: CREATE TABLE issues ( issue_id SERIAL PRIMARY_KEY, issue_type CHAR(1) CHECK (issue_type IN ('B', 'F')), ...
-1
votes
1answer
1k views

Using value of a column in another table for ENUM/SET values

I have two tables tbl_events with a column location_id. Then I have a table specifically to hold locations and their IDs,the columns in table tbl_locations are location_id and name. I want the ...
1
vote
2answers
209 views

PROCEDURE ANALYSE suggests to turn timestamp into CHAR(19)

Using Procedure Analyse() under MySQL 5.6.30 on a table with about 4 million rows makes the following recommendations: change timestamp to char(19) tinyint to ENUM (I noticed it's overzealous with ...
1
vote
1answer
169 views

MySQL Enums have non-intuitive behaviour, why?

This very helpful article explains some oddities about how MySQL Enums behave: http://melp.nl/2009/05/mysql-enums-and-booleans/ There is no discussiong about why that behaviour exists. Furthermore, ...
0
votes
0answers
1k views

Using an enum as part of an index definition

When I use an ENUM column in a table the ORDER BY uses the ordinal of the ENUM not its value. I wasn't aware of that. So my question is what are the subtle issues when an ENUM is part of an index ...
1
vote
1answer
5k views

How to change a column type from SET to an ENUM

I have a table with a SET column type that need to be changed to ENUM type. Can I do it with a simple ALTER or will this mess up my data? NB: there are no multiple values (a,b,c) in the table.