|
From: Calin Pirtea\(RDS\) <pc...@rd...> - 2009-11-16 23:23:44
|
Hi Ann, While I understand and mostly agree with what you say I argue that not performing a full table update can be as good as it is bad. Implementation can make it good if done realy well. My argument is that metadata changes to a production database are meant to be very rare hence a full table update is meant to be very rare for adding a new field. Reading a table on production databases, on the other hand, should be very often and if performance impact is 1% for these defaults, then reading a record 100 times it's already worth the effort to update the table to get that extra 1% performance back. Please correct my logic if wrong. Cheers, Calin. ----- Original Message ----- From: "Ann W. Harrison" > Calin Pirtea(RDS) wrote: >> >> Sounds to me like what you suggest is to create the not null field and on >> next read make it look like it has a value. That sounds sooo wrong to me. >> Currently, every time I create a new not null field I follow it with a >> full >> table update. >> > > It may sound wrong to you, but it is the general style that Firebird > and InterBase have used for years. When you add a column to a table, > Firebird generates a new record in RDB$FORMATS, describing the new > physical structure. Existing records are unchanged. When Firebird > reads a record, it compares the format version in the record header > with the format requested - which may not be the most recent, depending > on what's happening and how old the request is - and, if necessary, > moves the record forward or back to the requested format. So if you > add a field FOO to a table and read that table, you'll see a bunch > of null FOO's. They're not stored, but are created on reference. > If you update those records, they'll be stored in the new format > with the FOO field. > > What Adriano is proposing is a mechanism to add new fields with a > NOT NULL constraint without doing a full table update. That would > be a good thing. > > > Cheers, > > Ann > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > Firebird-Devel mailing list, web interface at > https://lists.sourceforge.net/lists/listinfo/firebird-devel |