Received: from smtp5.mail.yahoo.com (smtp5.mail.yahoo.com [128.11.69.102]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f19BD5x20553 for ; Fri, 9 Feb 2001 06:13:05 -0500 (EST) (envelope-from janwieck@yahoo.com) Received: from a5822.pppool.de (HELO jupiter.greatbridge.com) (213.6.88.34) by smtp.mail.vip.suc.yahoo.com with SMTP; 9 Feb 2001 11:06:29 -0000 X-Apparently-From: Received: (from janwieck@localhost) by jupiter.greatbridge.com (8.9.3/8.9.3) id QAA11064; Thu, 8 Feb 2001 16:56:04 -0500 From: Jan Wieck Message-Id: <200102082156.QAA11064@jupiter.greatbridge.com> Subject: Re: Re: Re: Postgres and Oracle differences and questions In-Reply-To: <11884.981644457@sss.pgh.pa.us> from Tom Lane at "Feb 8, 2001 10:00:57 am" To: Tom Lane Date: Thu, 8 Feb 2001 16:56:04 -0500 (EST) CC: Jan Wieck , Hannu Krosing , "D. Johnson" , pgsql-interfaces@postgresql.org X-Mailer: ELM [version 2.4ME+ PL68 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archive-Number: 200102/71 X-Sequence-Number: 1024 Tom Lane wrote: > Jan Wieck writes: > > Tom Lane wrote: > >> Speaking of which, though, it looks like an update or insert will > >> forcibly uncompress (and later recompress) a compressed-in-line datum, > >> which seems like a waste of cycles to me. Jan, shouldn't the test for > >> VARATT_IS_EXTENDED at line 357 instead read VARATT_IS_EXTERNAL? > > > Not without some more logic added. > > We don't have any admin commands yet that can modify the > > toasters strategy on the attribute level, but the config > > attributes in the tuple descriptor are already there. So you > > can tell the toaster per attribute if it should try to > > compress or not, if it should try to keep the attribute in > > the main tuple harder and the like. You have to modify > > pg_attribute yourself for now, where we might want to have > > some ALTER TABLE, don't we? > > What's your point here? I wouldn't think that changing the strategy > for a column to "plain" should mean that already-stored values get > uncompressed when they're not being modified. Someone who did expect > that would probably want the ALTER TABLE command to go through and > redo the representation of each row immediately, anyway. > > ISTM what's really at stake is simply how fast does a strategy change > propagate to the individual rows of a table. Given that the strategy > values are mostly just hints anyway, it's not clear to me why you > insist that changing "x" to "p" must cause decompression at the first > touch of a row containing a value, and not either earlier (immediately > upon strategy-altering command) or later (when the value in question > is actually replaced with something different). > > > IIRC the above should only be invoked if you do something > > like INSERT ... SELECT, where the already toasted value is > > coming from another tuple than the one you're actually > > creating/updating. > > No, the problem comes up in a plain UPDATE, if it's altering other > fields in the same row. Look again at the code: the comment claims > that the UPDATE case has been taken care of above, but that is true > only for an externally stored value. So a compressed-in-line field > that has been copied from the old tuple will be uncompressed and > (presumably) recompressed by the current logic. I say that's silly; > we should not pay a performance penalty that large just to have a very > subtly different speed of response to strategy-altering commands that > don't exist yet. It does? Uh - you're right. I wouldn't want to change it now, but ASAP in the 7.2 cycle. Bruce, please add * Don't decompress untouched toast values on UPDATE to TODO. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com # _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com