Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.
-
Upload
lynn-harmon -
Category
Documents
-
view
217 -
download
0
Transcript of Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.
![Page 1: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/1.jpg)
Trigger Happy - Getting around MySQL Limitations
Phil Hildebrandtheplatform.com
![Page 2: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/2.jpg)
Who says that can’t be done?
Maybe it can’t be done out of the box, but that’s doesn’t necessarily mean it can’t be done …
Restrictions are blinders
Think out of the box
If it’s not challenging, why bother?
![Page 3: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/3.jpg)
Triggers do come out of the box
Understand the challenge
Evaluate solutions
Look beyond test into production
![Page 4: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/4.jpg)
Foreign keys on partitioned tables
Challenge: How do foreign keys work?
![Page 5: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/5.jpg)
Challenge: How do foreign keys work?
Possible solutions?
Foreign keys on partitioned tables
![Page 6: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/6.jpg)
Challenge: How do foreign keys work?
Possible solutions?
Foreign keys on partitioned tables
![Page 7: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/7.jpg)
Challenge: How do foreign keys work?
Possible solutions?
What about production?
Foreign keys on partitioned tables
![Page 8: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/8.jpg)
Unique indexes on partitioned tables
What’s the challenge/problem?
![Page 9: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/9.jpg)
Unique indexes on partitioned tables
What’s the challenge/problem?
Possible solutions?
![Page 10: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/10.jpg)
Unique indexes on partitioned tables
What’s the challenge/problem?
Possible solutions?
![Page 11: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/11.jpg)
Unique indexes on partitioned tables
What’s the challenge/problem?
Possible solutions?
What about production?
![Page 12: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/12.jpg)
Conditional unique constraints
Columns from Separate Tables Must Be Unique
![Page 13: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/13.jpg)
Conditional unique constraints
Columns from Separate Tables Must Be Unique
Possible solutions?
![Page 14: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/14.jpg)
Conditional unique constraints
Columns from Separate Tables Must Be Unique
Possible solutions?
![Page 15: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/15.jpg)
Conditional unique constraints
Columns from Separate Tables Must Be Unique
Possible solutions?
What about production?
![Page 16: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/16.jpg)
Moving Innodb Tables/Partitions
Ideas?
![Page 17: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/17.jpg)
Moving Innodb Tables/Partitions
Ideas?
![Page 18: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/18.jpg)
Moving Innodb Tables/Partitions
Ideas?
![Page 19: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/19.jpg)
Ideas?
Moving Innodb Tables/Partitions
![Page 20: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/20.jpg)
Ideas?
Moving Innodb Tables/Partitions
![Page 21: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com.](https://reader036.fdocuments.net/reader036/viewer/2022062805/5697c00d1a28abf838cc9302/html5/thumbnails/21.jpg)
5 Minute Challenge
Global Index on a partitioned table ?
Foreign Keys to different engines?
New partition on insert ?
Parallel partition queries ?