Hi Alexandra, On Tue, Sep 17, 2019 at 4:45 PM Ashutosh Sharma <ashu.coe...@gmail.com> wrote: > > On Thu, Aug 29, 2019 at 5:39 PM Heikki Linnakangas <hlinn...@iki.fi> wrote: > > > > On 29/08/2019 14:30, Ashutosh Sharma wrote: > > > > > > On Wed, Aug 28, 2019 at 5:30 AM Alexandra Wang <lew...@pivotal.io > > > <mailto:lew...@pivotal.io>> wrote: > > Further, the UPDATE operation on zedstore table is very slow. I think > that's because in case of zedstore table we have to update all the > btree data structures even if one column is updated and that really > sucks. Please let me know if there is some other reason for it. >
There was no answer for this in your previous reply. It seems like you missed it. As I said earlier, I tried performing UPDATE operation with optimised build and found that to update around 10 lacs record in zedstore table it takes around 24k ms whereas for normal heap table it takes 2k ms. Is that because in case of zedstore table we have to update all the Btree data structures even if one column is updated or there is some other reason for it. If yes, could you please let us know. FYI, I'm trying to update the table with just two columns. Further, In the latest code I'm getting this warning message when it is compiled using -O2 optimisation flag. zedstore_tidpage.c: In function ‘zsbt_collect_dead_tids’: zedstore_tidpage.c:978:10: warning: ‘page’ may be used uninitialized in this function [-Wmaybe-uninitialized] opaque = ZSBtreePageGetOpaque(page); ^ Attached is the patch that fixes it. -- With Regards, Ashutosh Sharma EnterpriseDB:http://www.enterprisedb.com
diff --git a/src/backend/access/zedstore/zedstore_tidpage.c b/src/backend/access/zedstore/zedstore_tidpage.c index 7730ef3..f590f79 100644 --- a/src/backend/access/zedstore/zedstore_tidpage.c +++ b/src/backend/access/zedstore/zedstore_tidpage.c @@ -956,9 +956,10 @@ zsbt_collect_dead_tids(Relation rel, zstid starttid, zstid *endtid, uint64 *num_ buf = zsbt_descend(rel, ZS_META_ATTRIBUTE_NUM, nexttid, 0, true); if (!BufferIsValid(buf)) return result; - page = BufferGetPage(buf); } + page = BufferGetPage(buf); + maxoff = PageGetMaxOffsetNumber(page); for (off = FirstOffsetNumber; off <= maxoff; off++) {