Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id C6F352E0033 for ; Tue, 29 Apr 2008 10:00:22 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 60894-04 for ; Tue, 29 Apr 2008 09:59:39 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from el-out-1112.google.com (el-out-1112.google.com [209.85.162.181]) by developer.postgresql.org (Postfix) with ESMTP id D63D72E0032 for ; Tue, 29 Apr 2008 09:59:46 -0300 (ADT) Received: by el-out-1112.google.com with SMTP id j27so1739356elf.23 for ; Tue, 29 Apr 2008 05:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=vL8Mvl6MDmEDSemBDYoI0GJwWBCDxvbKTBaOLUnH7vU=; b=D3DvG2lvkjShS8fGdb8q9atq3ceVFjatVO9jXz1bE+c1ON/iKipzO/lh6a/uN33pxb0eDjmUnJMx471bSDGkZ/Epzo7N5jb+sJQ4Kx65DQ/eMGWWsHiiFIDiKfPXINgMbeTAIkdwp9XVCe5yXgAZFmalqD34+ndAPibtReOVnL4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=O/QRvkK83jRCz/5KT+BgCDf9OzAngaKQpC61y2RiEBS13Amy0LE3PhbnyneIbn5k8ZbP80A4yHoPyAVFGNOncdIzIIP9M+qZ2/x8VthefnfOfE6W7xokFFIIPi02nAzGH5ldhJv1c7xtZ7juQYQD+geaSiEHdf5+yBayzzNFfeE= Received: by 10.115.55.1 with SMTP id h1mr6612616wak.216.1209473983977; Tue, 29 Apr 2008 05:59:43 -0700 (PDT) Received: by 10.114.240.17 with HTTP; Tue, 29 Apr 2008 05:59:43 -0700 (PDT) Message-ID: <7e4ba9550804290559t7948d549j7e506154c0b1ed38@mail.gmail.com> Date: Tue, 29 Apr 2008 18:29:43 +0530 From: "Gauri Kanekar" To: "Pavan Deolasee" Subject: Re: Replication Syatem Cc: "Greg Smith" , pgsql-performance@postgresql.org In-Reply-To: <2e78013d0804290425n402f5e94i90bc7206aeefffdc@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1247_32469310.1209473983973" References: <7e4ba9550804280638ie81dc23w472785c83cd38fcf@mail.gmail.com> <7e4ba9550804280705q43c51e66l104a5ff9272bbd4d@mail.gmail.com> <20080428162243.GN2970@commandprompt.com> <7e4ba9550804282246p73c62fc6y5e7cb7dda55a6b50@mail.gmail.com> <7e4ba9550804290405i4c0d3a57x1640239c9995c13@mail.gmail.com> <2e78013d0804290425n402f5e94i90bc7206aeefffdc@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.9 tagged_above=0 required=5 tests=AWL=0.000, FS_REPLICA=1.179, HTML_MESSAGE=0.001, SARE_SPEC_REPLICA=0.72 X-Spam-Level: * X-Archive-Number: 200804/434 X-Sequence-Number: 29927 ------=_Part_1247_32469310.1209473983973 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanx for the help. Need some more help. "table1" has two indices unique indx1 = "pkfld" unique indx2 = "fkfld1,fkfld2" did following steps in the listed order - 1. vacuumed the whole DB 2. "table1" RecCnt ==> 11970789 Size ==> 2702.41 MB 3.update "table1" set fld7 = 1000 where fld1/1000000 = 999 ; this UPDATED 1230307 records 4. checked "table1" size again Reccnt => 11970789 Size ==> 2996.57MB 5. Again did the update, update "table1" set fld7 = 1000 where fld1/1000000 = 999 ; this UPDATED 1230307 records 6. Got "table1" size as RecCnt ==> 11970789 Size ==> 3290.64 7. Updated again, update "table1" set fld7 = 1000 where fld1/1000000 = 999 ; this UPDATED 1230307 records 6. "table1" size as RecCnt ==> 11970789 Size ==> 3584.66 Found that the size increased gradually. Is HOT working over here ?? Guide me if im doing something wrong. ~ Gauri On Tue, Apr 29, 2008 at 4:55 PM, Pavan Deolasee wrote: > On Tue, Apr 29, 2008 at 4:35 PM, Gauri Kanekar > wrote: > > > > > Do we need to do any special config changes or any other setting for HOT > to > > work?? > > No. HOT is enabled by default, on all tables. There is no way and need > to disable it. > > > > > Any special guideline to follow to make HOT working?? > > > > You can do couple of things to benefit from HOT. > > 1. HOT addresses a special, but common case where UPDATE operation > does not change any of the index keys. So check if your UPDATE changes > any of the index keys. If so, see if you can avoid having index > involving that column. Of course, I won't advocate dropping an index > if it would drastically impact your frequently run queries. > > 2. You may leave some free space in the heap (fillfactor less than > 100). My recommendation would be to leave space worth of one row or > slightly more than that to let first UPDATE be an HOT update. > Subsequent UPDATEs in the page may reuse the dead row created by > earlier UPDATEs. > > 3. Avoid any long running transactions. > > Thanks, > Pavan > > -- > Pavan Deolasee > EnterpriseDB http://www.enterprisedb.com > -- Regards Gauri ------=_Part_1247_32469310.1209473983973 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanx for the help.

Need some more help.

"table1" has two indices
unique indx1 = "pkfld"
unique indx2 = "fkfld1,fkfld2"

did following steps in the listed order -

1. vacuumed the whole DB
2. "table1" 
      RecCnt ==> 11970789
      Size ==> 2702.41 MB
3.update "table1" set fld7 = 1000 where fld1/1000000 = 999 ;
    this UPDATED 1230307 records
4. checked "table1" size again
     Reccnt =>   11970789
     Size ==> 2996.57MB
5. Again did the update, update "table1" set fld7 = 1000 where fld1/1000000 = 999 ;
    this UPDATED 1230307 records
6. Got "table1" size as
    RecCnt ==> 11970789
    Size ==> 3290.64
7. Updated again, update "table1" set fld7 = 1000 where fld1/1000000 = 999 ;
    this UPDATED 1230307 records
6. "table1" size as
    RecCnt ==> 11970789
    Size ==> 3584.66

Found that the size increased gradually. Is HOT working over here ??
Guide me if im doing something wrong.

~ Gauri

On Tue, Apr 29, 2008 at 4:55 PM, Pavan Deolasee <pavan.deolasee@gmail.com> wrote:
On Tue, Apr 29, 2008 at 4:35 PM, Gauri Kanekar
<meetgaurikanekar@gmail.com> wrote:

>
> Do we need to do any special config changes or any other setting for HOT to
> work??

No. HOT is enabled by default, on all tables. There is no way and need
to disable it.

>
> Any special guideline to follow to make HOT working??
>

You can do couple of things to benefit from HOT.

1. HOT addresses a special, but common case where UPDATE operation
does not change any of the index keys. So check if your UPDATE changes
any of the index keys. If so, see if you can avoid having index
involving that column. Of course, I won't advocate dropping an index
if it would drastically impact your frequently run queries.

2. You may leave some free space in the heap (fillfactor less than
100). My recommendation would be to leave space worth of one row or
slightly more than that to let first UPDATE be an HOT update.
Subsequent UPDATEs in the page may reuse the dead row created by
earlier UPDATEs.

3. Avoid any long running transactions.

Thanks,
Pavan

--
Pavan Deolasee
EnterpriseDB http://www.enterprisedb.com



--
Regards
Gauri ------=_Part_1247_32469310.1209473983973--