pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Gratuitous use of savepoint considered silly, if not harmful
2+ messages / 2 participants
[nested] [flat]

* Gratuitous use of savepoint considered silly, if not harmful
@ 2018-04-13 18:32 Jerry Sievers <gsievers19@comcast.net>
  2018-04-13 18:39 ` Re: Gratuitous use of savepoint considered silly, if not harmful Melvin Davidson <melvin6925@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Jerry Sievers @ 2018-04-13 18:32 UTC (permalink / raw)
  To: pgsql-general

So I'm (was) puzzled here when a big warehouse system just upgraded to
9.6 which I knew does only a few 100k *real* transactions/day was
wrapping txid_current() so fast, in turn causing some big, nasty tablesl
to age and then require painful long-running vacuums...

Got the brilliant idea to full statement log for just 20 minutes or so
and then do some digging.

OMG my DW team's Pentaho/Kettle driver gizmo emulates single-line
autocommit inserts using savepoints.

It racked up ~1.8M txids meanwhile actually doing only ~900
transactions.

Symptomatic of this also is that your pg_stat_database.(xact_commit +
xact_rollback) counter over time will be wildly smaller then the
advancement of txid_current() perhaps helping in the confusion.

This was csvlogged and field #8 is command-tag which we're pulling out

and summarizing as seen below.

tmp$ grep ^2018 $log-file | grep silly_etl_user | cut -d, -f8 | sort | uniq -c | sort -k1,1bnr -k2

1880283 "INSERT"
1879931 "RELEASE"
1879931 "SAVEPOINT"
 314838 "SELECT"
 314298 "UPDATE"
   2681 "idle"
   2677 "authentication"
   1967 "SET"
    898 "COMMIT"
    897 "BEGIN"
    160 "DELETE"
     83 "TRUNCATE TABLE"
      6 "DROP TABLE"
      2 "CREATE INDEX"
      2 "CREATE TABLE AS"

Anyway, I felt this was worth sharing :-)

Thx

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 312.241.7800




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Gratuitous use of savepoint considered silly, if not harmful
  2018-04-13 18:32 Gratuitous use of savepoint considered silly, if not harmful Jerry Sievers <gsievers19@comcast.net>
@ 2018-04-13 18:39 ` Melvin Davidson <melvin6925@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Melvin Davidson @ 2018-04-13 18:39 UTC (permalink / raw)
  To: Jerry Sievers <gsievers19@comcast.net>; +Cc: pgsql-general

On Fri, Apr 13, 2018 at 2:32 PM, Jerry Sievers <gsievers19@comcast.net>
wrote:

> So I'm (was) puzzled here when a big warehouse system just upgraded to
> 9.6 which I knew does only a few 100k *real* transactions/day was
> wrapping txid_current() so fast, in turn causing some big, nasty tablesl
> to age and then require painful long-running vacuums...
>
> Got the brilliant idea to full statement log for just 20 minutes or so
> and then do some digging.
>
> OMG my DW team's Pentaho/Kettle driver gizmo emulates single-line
> autocommit inserts using savepoints.
>
> It racked up ~1.8M txids meanwhile actually doing only ~900
> transactions.
>
> Symptomatic of this also is that your pg_stat_database.(xact_commit +
> xact_rollback) counter over time will be wildly smaller then the
> advancement of txid_current() perhaps helping in the confusion.
>
> This was csvlogged and field #8 is command-tag which we're pulling out
>
> and summarizing as seen below.
>
> tmp$ grep ^2018 $log-file | grep silly_etl_user | cut -d, -f8 | sort |
> uniq -c | sort -k1,1bnr -k2
>
> 1880283 "INSERT"
> 1879931 "RELEASE"
> 1879931 "SAVEPOINT"
>  314838 "SELECT"
>  314298 "UPDATE"
>    2681 "idle"
>    2677 "authentication"
>    1967 "SET"
>     898 "COMMIT"
>     897 "BEGIN"
>     160 "DELETE"
>      83 "TRUNCATE TABLE"
>       6 "DROP TABLE"
>       2 "CREATE INDEX"
>       2 "CREATE TABLE AS"
>
> Anyway, I felt this was worth sharing :-)
>
> Thx
>
> --
> Jerry Sievers
> Postgres DBA/Development Consulting
> e: postgres.consulting@comcast.net
> p: 312.241.7800
>
>
*As Forest Gump once said "Stupid is as stupid does". *😁


-- 
*Melvin Davidson*
*Maj. Database & Exploration Specialist*
*Universe Exploration Command – UXC*
Employment by invitation only!

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2018-04-13 18:39 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-04-13 18:32 Gratuitous use of savepoint considered silly, if not harmful Jerry Sievers <gsievers19@comcast.net>
2018-04-13 18:39 ` Melvin Davidson <melvin6925@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox