Thread: Hot Issue

Hot Issue

From
"Gauri Kanekar"
Date:
Hi all,

We have upgraded our database server to postgres 8.3.1 on 28th June.

Checked out the performance of Hot on 30th June :

relname             n_tup_ins  n_tup_upd  n_tup_del  n_tup_hot_upd  n_live_tup  n_dead_tup 
table1155091562884653024428231550915868046
table2434585718472064233643470316723
table310554625214302330781054024922
table47303628960981767902344571268383443
table5111170452224501691011117045440


Checked the performance of Hot on 2nd July :

relname             n_tup_ins  n_tup_upd  n_tup_del  n_tup_hot_upd  n_live_tup  n_dead_tup 
table11557772462372420292494818460676131103
table243555815796130763397117149742476
table3105814540997027344335528714184
table4761475221932951326841053742472162
table5111843094766502119811206296745



































Performance of Hot was much better on 30June as compared to 2nd July.

Can anybody , help out over here.

~ Gauri
relname            
 n_tup_ins 
 n_tup_upd 
 n_tup_del 
 n_tup_hot_upd 
 n_live_tup 
 n_dead_tup 


--
Regards
Gauri

Re: Hot Issue

From
"Jonah H. Harris"
Date:
On Wed, Jul 2, 2008 at 8:31 AM, Gauri Kanekar
<meetgaurikanekar@gmail.com> wrote:
> Performance of Hot was much better on 30June as compared to 2nd July.

Did you happen to VACUUM FULL or CLUSTER anything?

--
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
499 Thornall Street, 2nd Floor | jonah.harris@enterprisedb.com
Edison, NJ 08837 | http://www.enterprisedb.com/

Re: Hot Issue

From
"Gauri Kanekar"
Date:
No, Vacuum Full was not done, but auto_vacuum did click onto table1.

No cluster.


On Wed, Jul 2, 2008 at 6:10 PM, Jonah H. Harris <jonah.harris@gmail.com> wrote:
On Wed, Jul 2, 2008 at 8:31 AM, Gauri Kanekar
<meetgaurikanekar@gmail.com> wrote:
> Performance of Hot was much better on 30June as compared to 2nd July.

Did you happen to VACUUM FULL or CLUSTER anything?

--
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
499 Thornall Street, 2nd Floor | jonah.harris@enterprisedb.com
Edison, NJ 08837 | http://www.enterprisedb.com/



--
Regards
Gauri

Re: Hot Issue

From
Devrim GÜNDÜZ
Date:
On Wed, 2008-07-02 at 18:01 +0530, Gauri Kanekar wrote:
> Checked out the performance of Hot on 30th June :
>
>     relname              n_tup_ins   n_tup_upd   n_tup_del
> n_tup_hot_upd
>  n_live_tup   n_dead_tup   *table1* *15509156* *2884653* *0* *2442823*
> *
> 15509158* *68046*  table2 434585 718472 0 642336 434703 16723  table3
> 105546
> 252143 0 233078 105402 4922
<snip>
>
> Checked the performance of Hot on 2nd July :
>
>     relname              n_tup_ins   n_tup_upd   n_tup_del
> n_tup_hot_upd
>  n_live_tup   n_dead_tup   *table1**15577724* *6237242* *0* *2924948*
> *
> 18460676* *131103*  table2 435558 1579613 0 763397 1171497 42476

Maybe those updates were not qualified for HOT between these days?

Regards,
--
Devrim GÜNDÜZ
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
                   http://www.gunduz.org


Attachment

Re: Hot Issue

From
"Gauri Kanekar"
Date:

How does it indicate if the entries qualify for hot update ??

hot have a limitation that it do not work if, the index column is updated. But that not the case over here.



On Wed, Jul 2, 2008 at 6:38 PM, Devrim GÜNDÜZ <devrim@gunduz.org> wrote:
On Wed, 2008-07-02 at 18:01 +0530, Gauri Kanekar wrote:
> Checked out the performance of Hot on 30th June :
>
>     relname              n_tup_ins   n_tup_upd   n_tup_del
> n_tup_hot_upd
>  n_live_tup   n_dead_tup   *table1* *15509156* *2884653* *0* *2442823*
> *
> 15509158* *68046*  table2 434585 718472 0 642336 434703 16723  table3
> 105546
> 252143 0 233078 105402 4922
<snip>
>
> Checked the performance of Hot on 2nd July :
>
>     relname              n_tup_ins   n_tup_upd   n_tup_del
> n_tup_hot_upd
>  n_live_tup   n_dead_tup   *table1**15577724* *6237242* *0* *2924948*
> *
> 18460676* *131103*  table2 435558 1579613 0 763397 1171497 42476

Maybe those updates were not qualified for HOT between these days?

Regards,
--
Devrim GÜNDÜZ
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
                  http://www.gunduz.org




--
Regards
Gauri

Re: Hot Issue

From
"Jonah H. Harris"
Date:
On Wed, Jul 2, 2008 at 9:11 AM, Gauri Kanekar
<meetgaurikanekar@gmail.com> wrote:
> hot have a limitation that it do not work if, the index column is updated.
> But that not the case over here.

Another limitation is that HOT won't work if there's not enough space
to fit the update on the same page.

--
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
499 Thornall Street, 2nd Floor | jonah.harris@enterprisedb.com
Edison, NJ 08837 | http://www.enterprisedb.com/

Re: Hot Issue

From
Devrim GÜNDÜZ
Date:
On Wed, 2008-07-02 at 18:41 +0530, Gauri Kanekar wrote:
> hot have a limitation that it do not work if, the index column is
> updated.

It is one of the conditions -- it also needs to fit in the same block.

Regards,
--
Devrim GÜNDÜZ
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
                   http://www.gunduz.org


Attachment

Re: Hot Issue

From
"Gauri Kanekar"
Date:
ok.. But we have set fill_factor = 80 for all the indexes on table1.

Is there a way to check if the page is fill and the update is going on a new page ??



On Wed, Jul 2, 2008 at 6:59 PM, Jonah H. Harris <jonah.harris@gmail.com> wrote:
On Wed, Jul 2, 2008 at 9:11 AM, Gauri Kanekar
<meetgaurikanekar@gmail.com> wrote:
> hot have a limitation that it do not work if, the index column is updated.
> But that not the case over here.

Another limitation is that HOT won't work if there's not enough space
to fit the update on the same page.

--
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
499 Thornall Street, 2nd Floor | jonah.harris@enterprisedb.com
Edison, NJ 08837 | http://www.enterprisedb.com/



--
Regards
Gauri

Re: Hot Issue

From
"Jonah H. Harris"
Date:
On Wed, Jul 2, 2008 at 9:44 AM, Gauri Kanekar
<meetgaurikanekar@gmail.com> wrote:
> ok.. But we have set fill_factor = 80 for all the indexes on table1.

You need fill factor for the heap table, not the index.

> Is there a way to check if the page is fill and the update is going on a new
> page ??

IIRC, I don't think so.  I think you'd have to u se something like
pg_filedump to see if you have rows migrated to other blocks due to
updates.

--
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
499 Thornall Street, 2nd Floor | jonah.harris@enterprisedb.com
Edison, NJ 08837 | http://www.enterprisedb.com/

Re: Hot Issue

From
Tom Lane
Date:
"Jonah H. Harris" <jonah.harris@gmail.com> writes:
> On Wed, Jul 2, 2008 at 9:44 AM, Gauri Kanekar
>> Is there a way to check if the page is fill and the update is going on a new
>> page ??

> IIRC, I don't think so.

You could make your application check to see if the page part of a row's
CTID changes when it's updated.  But there's no centralized counter
other than the one you are already looking at.

I personally found the original post completely content-free, however,
since it gave no context for the two sets of numbers we were shown.
Over what intervals were the counts accumulated?  Were the stats
counters reset after taking the first output, or does the second output
include the first?  What exactly does the OP think that "better HOT
performance" is, anyway?

            regards, tom lane

Re: Hot Issue

From
"Gauri Kanekar"
Date:

2nd count include the 1st count also.

We have not restarted the DB since postgres 8.3 have been released.

Better HOT performance means.... 1st stat showed most of the updated tuples getting hot.
But the 2nd stat showed that most of the updated tuples are NOT getting hot.



On Wed, Jul 2, 2008 at 8:10 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"Jonah H. Harris" <jonah.harris@gmail.com> writes:
> On Wed, Jul 2, 2008 at 9:44 AM, Gauri Kanekar
>> Is there a way to check if the page is fill and the update is going on a new
>> page ??

> IIRC, I don't think so.

You could make your application check to see if the page part of a row's
CTID changes when it's updated.  But there's no centralized counter
other than the one you are already looking at.

I personally found the original post completely content-free, however,
since it gave no context for the two sets of numbers we were shown.
Over what intervals were the counts accumulated?  Were the stats
counters reset after taking the first output, or does the second output
include the first?  What exactly does the OP think that "better HOT
performance" is, anyway?

                       regards, tom lane



--
Regards
Gauri

Re: Hot Issue

From
Tom Lane
Date:
"Gauri Kanekar" <meetgaurikanekar@gmail.com> writes:
> Better HOT performance means.... 1st stat showed most of the updated tuples
> getting hot.
> But the 2nd stat showed that most of the updated tuples are NOT getting hot.

Well, as was noted upthread, you'd want to reduce the table fillfactor
(not index fillfactor) below 100 to improve the odds of being able to
do HOT updates.  But I wonder whether your application behavior changed.
Are you updating the rows in a way that'd make them wider?

            regards, tom lane