Re: [Maria-developers] Triangular FKs - Cascade delete leaves DB in state with broken referential integrity

2018-02-03 Thread Oliver Schonrock
On 03/02/18 22:58, Oliver Schonrock wrote: > I have managed to simplify the test case further, by eliminating the > "circular" ON DELETE SET NULL Contraints and their fields. Now it's a > simple: > > parent => child1 >=> child2 with ON DELETE SET NULL FK to child1 to complete a > "triangle

Re: [Maria-developers] Partial indexes?

2018-02-03 Thread James Briggs
Hi Jared and Sergei. I've been doing some work with Postgresql, and have learned more abouthow partial indexes are used. It seems partial indexes are a general "design pattern" they use to: 1) have smaller indexes by including less rows2) reduce write-amplification performance issuesas Postgresql

Re: [Maria-developers] Triangular FKs - Cascade delete leaves DB in state with broken referential integrity

2018-02-03 Thread Oliver Schonrock
On 03/02/18 13:42, Oliver Schonrock wrote: > How to reproduce: (example reduced to the bare essentials with 3 tables > with 1 record each). I have managed to simplify the test case further, by eliminating the "circular" ON DELETE SET NULL Contraints and their fields. Now it's a simple: parent =>

Re: [Maria-developers] Triangular FKs - Cascade delete leaves DB in state with broken referential integrity

2018-02-03 Thread Oliver Schonrock
Further info below: On 03/02/18 13:42, Oliver Schonrock wrote: > DELETE FROM member WHERE id = 1; > > SELECT * FROM member; > [ empty ] > > SELECT * FROM address; > [ empty ] > > SELECT * FROM payment_method; > ++---+---+ > | id | member_id | cardholder_address_i

Re: [Maria-developers] Triangular FKs - Cascade delete leaves DB in state with broken referential integrity

2018-02-03 Thread Oliver Schonrock
On 03/02/18 13:43, Oliver Schonrock wrote: > So, I have just done the test with 10.1, and can confirm that 10.1 DOES > NOT exhibit this broken behaviour. Of course there was switch from > Percona XtraDB to InnoDB engine between 10.1 and 10.2... MySQL 5.7.21 also works fine... InnoDB differences

Re: [Maria-developers] Triangular FKs - Cascade delete leaves DB in state with broken referential integrity

2018-02-03 Thread Oliver Schonrock
On 03/02/18 13:42, Oliver Schonrock wrote: > After recent upgrade from 10.1 to 10.2.12, > we promptly got broken FKs. (I have not yet retested with 10.1). So, I have just done the test with 10.1, and can confirm that 10.1 DOES NOT exhibit this broken behaviour. Of course there was switch from Perc

[Maria-developers] Triangular FKs - Cascade delete leaves DB in state with broken referential integrity

2018-02-03 Thread Oliver Schonrock
Initially posted on "discuss" list... I have come across a very strange symptom with triangular FKs (see below) where a cascade delete of the central (member) record leaves the DB in a state with broken referential integrity. The FK structure is a little bit demanding and somewhat "triangular/cir