[Dbix-class] how to empty a Table? when there is no primary key

demerphq demerphq at gmail.com
Wed Mar 27 13:50:53 GMT 2013


On 27 March 2013 13:33, David Cantrell <david at cantrell.org.uk> wrote:
> On Wed, Mar 27, 2013 at 06:12:49AM +1100, Peter Rabbitson wrote:
>> On Mon, Mar 25, 2013 at 03:57:45PM +0000, David Cantrell wrote:
>> > I've always thought that this is something that should be handled by the
>> > database, not by DBIx::Class - or at least that it should be something
>> > that you have to explicitly turn on in DBIx::Class to support data
>> > sources which don't really do relationships.
>> When DBIC was first worked on (2005) most available data sources either
>> did not handle FK constraints or (much more often the case, even today)
>> did not have them declared.
>
> Not having them declared in the table definitions is, IMO, a bug in the
> database design and the application.

In highly parallel high load scenarios this is most definitely not
true. FK's aren't scalable and are a performance bottleneck, and as
such tend to be the first thing that gets removed when load and scale
increases.

Its been a long time since I worked on a dataset that fit into a
single database, and where FK's were used with any kind of regularity.

You might find it interesting to read up on the difference between
BASE and ACID and why BASE scales but ACID doesn't.

http://www.johndcook.com/blog/2009/07/06/brewer-cap-theorem-base/

Yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"



More information about the DBIx-Class mailing list