On Thu, Aug 30, 2018 at 12:30 PM Alexander Korotkov <a.korot...@postgrespro.ru> wrote: > On Thu, Aug 30, 2018 at 12:17 PM Alexander Korotkov > <a.korot...@postgrespro.ru> wrote: > > # Current patch (use list) > > x run 1 run 2 run 3 > > 0.1 1206 1230 1231 > > 0.01 2862 2813 2802 > > 0.003 13915 13911 13900 > > Sorry, I didn't explain what these tables means. There are times in > milliseconds for 3 runs of spgist_bench($x, $x)
Right, performance regression appears to be caused by queue memory context allocation. I've tried to apply the same approach that we've in GiST: allocate separate memory context for queue only at second rescan call. And it appears to work, there is no measurable regression in comparison to master. Patch v8 x run 1 run 2 run 3 0.1 680 660 662 0.01 1403 1395 1508 0.003 6561 6475 6223 Revised version of patch is attached. I've squashed patchset into one patch. Later I'll split it into fewer parts before committing. I'm going to also make some benchmarking of KNN itself: GiST vs SP-GiST. ------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
knn-spgist-v8.patch
Description: Binary data