Re: Patch: Optimize memory allocation in function 'bringetbitmap' - Mailing list pgsql-hackers

From zhangjinyu
Subject Re: Patch: Optimize memory allocation in function 'bringetbitmap'
Date
Msg-id 1443451254826-5867647.post@n5.nabble.com
Whole thread Raw
In response to Re: Patch: Optimize memory allocation in function 'bringetbitmap'  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: Patch: Optimize memory allocation in function 'bringetbitmap'  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Yes,  I forgot disable-c-assert last test.  
The following show the test result when disable-c-assert.
I think it's still worthwhile.
*After optimize code (warm run)*
postgres=# select count(*) from lineitem where l_orderkey=1;count 
-------    6
(1 row)

Time: 327.143 ms
*Before optimizing code (warm run)*
postgres=# select count(*) from lineitem where l_orderkey=1;count 
-------    6
(1 row)

Time: 404.323 ms

>>>>However I wonder if it would be simpler to have the dtup structure have
>>>>the pointers, so that you can pass it as NULL in the first call and then
>>>>followup calls reuse the one allocated in the first call.
Jinyu:  the memory is allocated from perRangeCxt  and perRangeCxt will be
reset in loop,
so this way don't work. 

Jinyu Zhang



--
View this message in context:
http://postgresql.nabble.com/Patch-Optimize-memory-allocation-in-function-bringetbitmap-tp5867537p5867647.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.



pgsql-hackers by date:

Previous
From: Marti Raudsepp
Date:
Subject: Re: BRIN indexes for MAX, MIN, ORDER BY?
Next
From: zhangjinyu
Date:
Subject: Re: BRIN Scan: Optimize memory allocation in function 'bringetbitmap'