> > How do I simulate "ON DELETE RESTRICT" foreign key check using the
> > MyISAM engine?
> 
> Well, end of the day, you can't truly do it without a lot of table locking.
> Depending on how critically transactional your data is, something 
> like this would suffice:
> 
> LOCK TABLE all of the potentially affected tables
> 
> SELECT ID
>   FROM Table1 AS T1
> LEFT JOIN Table2 AS T2 ON T2.ID=T1.ID
>  WHERE T2.ID IS NULL
> 
> (assuming T2.ID is defined as not null)
> 
> Store the results of the above in a temp. table, or iterate over 
> each in PHP and issue a DELETE statement.
> 
> UNLOCK TABLE ...


> > Should I split the full text search product table into an innodb
> > table for the keys and a myisam table for the text?
> 
> That might be the best way to go.  Remember, depending on how
> ....
> between Innodb and MyISAM.  Then again, with the right schema, maybe 
> you can make the MyISAM tables strictly leaf tables, and easier to 

Hans:

Good point regarding the table lock. The more I learn about it, the more I
like InnoDB. Other than a flat file residing on an island, it seems like
everything ends of having some sort of referential integrity issues at some 
point.

Thanks,
Cliff
_______________________________________________
New York PHP Community MySQL SIG
http://lists.nyphp.org/mailman/listinfo/mysql

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to