| From: | Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com> | 
|---|---|
| To: | Peter Geoghegan <pg(at)heroku(dot)com> | 
| Cc: | Pg Hackers <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: Abbreviated keys for Numeric (was: Re: B-Tree support function number 3 (strxfrm() optimization)) | 
| Date: | 2015-02-21 00:11:19 | 
| Message-ID: | 54E7CD27.3070408@2ndquadrant.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On 21.2.2015 00:14, Peter Geoghegan wrote:
> On Fri, Feb 20, 2015 at 1:33 PM, Tomas Vondra 
> <tomas(dot)vondra(at)2ndquadrant(dot)com> wrote:
>> For example with the same percentile_disc() test as in the other
>> thread:
>> 
>> create table stuff as select random()::numeric as randnum from
>> generate_series(1,1000000);
>> 
>> analyze stuff;
>> 
>> select percentile_disc(0) within group (order by randnum) from
>> stuff;
>> 
>> 
>> I get pretty much no difference in runtimes (not even for the
>> smallest dataset, where the Datum patch speedup was significant).
>> 
>> What am I doing wrong?
> 
> So you're testing both the patches (numeric + datum tuplesort) at the
> same time?
No, I was just testing two similar patches separately. I.e. master vs.
each patch separately.
> I can't think why this would make any difference. Did you forget to 
> initdb, so that the numeric sortsupport routine was used?
No, but just to be sure I repeated the benchmarks and I still get the
same results. Each test run does this:
1) remove data directory
2) initdb
3) copy postgresql.conf (with minor tweaks - work_mem/shared_buffers)
4) start
5) create database
6) create test table
7) run a query 5x
I repeated this, just to be sure, but nope - still no speedup :-(
For master vs. patch, I do get these results:
                                 master   patched   speedup
   ---------------------------------------------------------
    generate_series(1,1000000)     1.20      1.25   0.96
    generate_series(1,2000000)     2.75      2.75   1.00
    generate_series(1,3000000)     4.40      4.40   1.00
So, no difference :(
Scripts attached, but it's really trivial test - hopefully I haven't
done anything dumb.
-- 
Tomas Vondra                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
| Attachment | Content-Type | Size | 
|---|---|---|
| reinit.sh | application/x-shellscript | 204 bytes | 
| bench.sh | application/x-shellscript | 723 bytes | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Peter Geoghegan | 2015-02-21 00:17:13 | Re: Abbreviated keys for Numeric (was: Re: B-Tree support function number 3 (strxfrm() optimization)) | 
| Previous Message | Peter Geoghegan | 2015-02-20 23:58:53 | Re: INSERT ... ON CONFLICT UPDATE and logical decoding |