Re: Super bizarre changing variable!!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Brian Dunning wrote:
> I definitely misunderstood what you guys are saying about the length.
> That's clearly a problem for a lot of my values.
> 
> I can switch them both to bigint. One table has 34,000,000 records and
> it's OK if this is hung up for a few minutes but not much longer than
> that - any chance this change might take longer than 5 or 10 minutes?

It can take a while depending on the power of your server, the load it's
under and the number of indexes you have on the table etc.

I've had updates on large tables take like 20-30 minutes before :(

One thing you can do to help reduce the posibility of having mismatched
fields like this in the future is to use a DB Storage backend that
supports Foreign keys e.g. InnoDB or the next version of MyISAM (I
think) for MySQL... Foreign keys basically tell the DB engine "this
field in this table can only except values that are entered into this
other field in this other table". The DB will refuse to let you add a
foreign key if the fields are different types.

There are many other advantages to foreign keys too, like ensuring data
integrity at the DB level (making the application logic simpler in many
cases) and vastly simplifying delete operations through the use of
cascading deletes.

Anyways, food for thought perhaps.

Col

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux