22
Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

Embed Size (px)

Citation preview

Page 1: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

Trigger Happy - Getting around MySQL Limitations

Phil Hildebrandtheplatform.com

Page 2: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

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

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

Foreign keys on partitioned tables

Challenge: How do foreign keys work?

Page 5: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

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

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

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

Unique indexes on partitioned tables

What’s the challenge/problem?

Page 9: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

Unique indexes on partitioned tables

What’s the challenge/problem?

Possible solutions?

Page 10: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

Unique indexes on partitioned tables

What’s the challenge/problem?

Possible solutions?

Page 11: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

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

Conditional unique constraints

Columns from Separate Tables Must Be Unique

Page 13: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

Conditional unique constraints

Columns from Separate Tables Must Be Unique

Possible solutions?

Page 14: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

Conditional unique constraints

Columns from Separate Tables Must Be Unique

Possible solutions?

Page 15: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

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

Moving Innodb Tables/Partitions

Ideas?

Page 17: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

Moving Innodb Tables/Partitions

Ideas?

Page 18: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

Moving Innodb Tables/Partitions

Ideas?

Page 19: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

Ideas?

Moving Innodb Tables/Partitions

Page 20: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

Ideas?

Moving Innodb Tables/Partitions

Page 21: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

5 Minute Challenge

Global Index on a partitioned table ?

Foreign Keys to different engines?

New partition on insert ?

Parallel partition queries ?

Page 22: Trigger Happy - Getting around MySQL Limitations Phil Hildebrand theplatform.com

Any questions?

Phil Hildebrand

[email protected]

opendba.blogspot.com