| From: | Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> | 
|---|---|
| To: | Andres Freund <andres(at)anarazel(dot)de> | 
| Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org> | 
| Subject: | Re: pgbench - implement strict TPC-B benchmark | 
| Date: | 2019-08-05 15:38:23 | 
| Message-ID: | alpine.DEB.2.21.1908051711210.25900@lancre | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
Hello Andres,
> If not, do you think advisable to spend time improving the evaluator & 
> variable stuff and possibly other places for an overall 15% gain?
>
> Also, what would be the likelyhood of such optimization patch to pass?
>
> I could do a limited variable management improvement patch, eventually, I 
> have funny ideas to speedup the thing, some of which outlined above, some 
> others even more terrible.
Attached is a quick PoC.
   sh> cat set.sql
   \set x 0
   \set y :x
   \set z :y
   \set w :z
   \set v :w
   \set x :v
   \set y :x
   \set z :y
   \set w :z
   \set v :w
   \set x :v
   \set y :x
   \set z :y
   \set w :z
   \set v :w
   \set x1 :x
   \set x2 :x
   \set y1 :z
   \set y0 :w
   \set helloworld :x
Before the patch:
   sh> ./pgbench -T 10 -f vars.sql
   ...
   tps = 802966.183240 (excluding connections establishing) # 0.8M
After the patch:
   sh> ./pgbench -T 10 -f vars.sql
   ...
   tps = 2665382.878271 (excluding connections establishing) # 2.6M
Which is a (somehow disappointing) * 3.3 speedup. The impact on the 3 
complex expressions tests is not measurable, though.
Probably variable management should be reworked more deeply to cleanup the 
code.
Questions:
  - how likely is such a patch to pass? (IMHO not likely)
  - what is its impact to overall performance when actual queries
    are performed (IMHO very small).
-- 
Fabien.
| Attachment | Content-Type | Size | 
|---|---|---|
| pgbench-symbols-1.patch | text/x-diff | 28.9 KB | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David Fetter | 2019-08-05 16:22:03 | Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions | 
| Previous Message | Christoph Berg | 2019-08-05 15:34:06 | Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions |