Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-31 Thread Alexander Korotkov
nlock-like procedures take place. > > + */ > > +typedef struct > > +{ > > + int spins; > > + int delays; > > + int cur_delay; > > + Pointer ptr; > > + const char *file

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-31 Thread Alexander Korotkov
Hi! On Thu, Mar 31, 2016 at 4:59 PM, Amit Kapila wrote: > On Tue, Mar 29, 2016 at 10:52 PM, Alexander Korotkov < > a.korot...@postgrespro.ru> wrote: > >> Hi, Andres! >> >> Please, find next revision of patch in attachment. >> >> > Couple of min

Re: [HACKERS] WIP: Access method extendability

2016-03-31 Thread Alexander Korotkov
his function. 8) BloomBuildState is explicitly zeroed. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company 0002-generic-xlog.15.patch Description: Binary data 0003-bloom-contrib.15.patch Description: Binary data -- Sent via pgsql-hackers mailing list

Re: [HACKERS] PoC: Partial sort

2016-03-30 Thread Alexander Korotkov
t; > >> * cost_sort() needs way way more comments. Doesn't even mention > >> indexes. Not worth commenting further on until I know what it's > >> *supposed* to do, though. > > > > > > I've added some comments. > > Looking at cos

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-30 Thread Alexander Korotkov
ngs, even Initdb hangs.. > > Yea, as Tom pointed out that's not going to work. I'll try to write a > patch for approach 1). > Great! Do you need any improvements for pinunpin-cas-7.patch from me? -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] WIP: Access method extendability

2016-03-30 Thread Alexander Korotkov
On Tue, Mar 29, 2016 at 8:34 PM, Alexander Korotkov < a.korot...@postgrespro.ru> wrote: > On Tue, Mar 29, 2016 at 8:29 PM, Teodor Sigaev wrote: > >> I incorporated your changes and did some additional refinements on top of >>> them >>> still. >>> &

Re: [HACKERS] SQL access to access method details

2016-03-30 Thread Alexander Korotkov
it. If not, default assumption is that this information shouldn't be exposed. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] WIP: Access method extendability

2016-03-29 Thread Alexander Korotkov
neric_xlog.c. I'm not fan of duplicating things. What about moving interface description from comments to docs completely? -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] PoC: Partial sort

2016-03-29 Thread Alexander Korotkov
ready for > committer". Will you have that ready soon? > Yes, that's it. I'm working on it now. I'm going to post it until tomorrow. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] WIP: Access method extendability

2016-03-29 Thread Alexander Korotkov
On Tue, Mar 29, 2016 at 6:20 PM, David Steele wrote: > On 3/28/16 1:26 PM, Alvaro Herrera wrote: > >> Alexander Korotkov wrote: >> >>> On Thu, Mar 24, 2016 at 6:19 PM, Alvaro Herrera < >>> alvhe...@2ndquadrant.com> >>> wrote: >>> >

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-28 Thread Alexander Korotkov
On Sun, Mar 27, 2016 at 4:31 PM, Alexander Korotkov < a.korot...@postgrespro.ru> wrote: > On Sun, Mar 27, 2016 at 3:10 PM, Andres Freund wrote: > >> On 2016-03-27 12:38:25 +0300, Alexander Korotkov wrote: >> > On Sat, Mar 26, 2016 at 1:26 AM, Alexander Korotkov <

Re: [HACKERS] WIP: Access method extendability

2016-03-28 Thread Alexander Korotkov
gt; >> > I did only cursory review on the bloom contrib module and don't really > have complaints there, but I know you can review that one. I'd like the > English of the generic_xlog.c description improved but I won't get to it > before weekend. What is your pla

[HACKERS] Autovacuum to prevent wraparound tries to consume xid

2016-03-28 Thread Alexander Korotkov
riableCache->nextXid. That completely fixes this situation for me: ShmemVariableCache was successfully updated. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company fix_vac_truncate_clog_xid_consume.patch Description: Binary data -- Sent via pgsql-hacker

Re: [HACKERS] [PATCH] Phrase search ported to 9.6

2016-03-28 Thread Alexander Korotkov
> > > I tested the patch and take a look on it. All regression tests passed. > > The code looks good and the patch introduce a great functionality. > > > > I think the patch can be marked as "Ready for Commiter". But I do not > > feel the force to do that my

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-27 Thread Alexander Korotkov
On Sun, Mar 27, 2016 at 3:10 PM, Andres Freund wrote: > On 2016-03-27 12:38:25 +0300, Alexander Korotkov wrote: > > On Sat, Mar 26, 2016 at 1:26 AM, Alexander Korotkov < > > a.korot...@postgrespro.ru> wrote: > > > > > Thank you very much for testing! >

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-27 Thread Alexander Korotkov
On Sat, Mar 26, 2016 at 1:26 AM, Alexander Korotkov < a.korot...@postgrespro.ru> wrote: > Thank you very much for testing! > I also got access to 4 x 18 Intel server with 144 threads. I'm going to > post results of tests on this server in next Monday. > I've run p

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-25 Thread Alexander Korotkov
Hi, Dilip! On Fri, Mar 25, 2016 at 8:32 PM, Dilip Kumar wrote: > On Fri, Mar 25, 2016 at 8:09 PM, Alexander Korotkov < > a.korot...@postgrespro.ru> wrote: > >> Could anybody run benchmarks? Feature freeze is soon, but it would be >> *very nice* to fit it into 9.

Re: [HACKERS] [PATCH] Phrase search ported to 9.6

2016-03-25 Thread Alexander Korotkov
t; > > Do you know when you'll have a chance to respond to reviews and provide a > new patch? > > Time is short and it's not encouraging that you say there is "still much > work to be done". Perhaps it would be best to mark this "returned with > feedba

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-25 Thread Alexander Korotkov
On Tue, Mar 22, 2016 at 1:08 PM, Alexander Korotkov < a.korot...@postgrespro.ru> wrote: > On Tue, Mar 22, 2016 at 7:57 AM, Dilip Kumar > wrote: > >> >> On Tue, Mar 22, 2016 at 12:31 PM, Dilip Kumar >> wrote: >> >>> ! pg_atomic_write_u32(&

Re: [HACKERS] WIP: Access method extendability

2016-03-25 Thread Alexander Korotkov
On Thu, Mar 24, 2016 at 6:19 PM, Alvaro Herrera wrote: > .. Oh crap. I just noticed I forgot to update a comment in pg_dump's > getAccessMethods. And we're missing psql tab-complete support for the > new commands. Attached patches fix both these issues. -- Alexande

Re: [HACKERS] [WIP] Effective storage of duplicates in B-tree index.

2016-03-24 Thread Alexander Korotkov
t; Everybody depends on it, all the time, for everything. And despite > new tools like amcheck, it's not a particularly easy thing to debug. > It's all true. But: 1) It's a great feature many users dream about. 2) Patch is not very big. 3) Patch doesn't introduce si

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-24 Thread Alexander Korotkov
Now, it's too late to include something new to 9.6. This is why I've rework it and publish at github as an extension for 9.6: https://github.com/postgrespro/pg_wait_sampling/ Hopefully, it could be considered as contrib for 9.7. -- Alexander Korotkov Postgres Pro

Re: [HACKERS] WIP: Access method extendability

2016-03-23 Thread Alexander Korotkov
On Tue, Mar 22, 2016 at 11:53 PM, Alvaro Herrera wrote: > Alexander Korotkov wrote: > > On Tue, Mar 22, 2016 at 1:26 AM, Alvaro Herrera < > alvhe...@2ndquadrant.com> > > wrote: > > > > I noticed this state of affairs because I started reading the complete >

Re: [HACKERS] improving GROUP BY estimation

2016-03-22 Thread Alexander Korotkov
Hi, Tomas! On Mon, Mar 21, 2016 at 2:39 PM, Alexander Korotkov < a.korot...@postgrespro.ru> wrote: > On Fri, Mar 18, 2016 at 1:20 PM, Dean Rasheed > wrote: > >> Probably a better URL to give is >> http://www.adellera.it/investigations/distinct_balls/ which has a li

Re: [HACKERS] pg_dump dump catalog ACLs

2016-03-22 Thread Alexander Korotkov
ACLs using <> funcs and using IS DISTINCT for other objects? Is it intentional? Assuming most of proacl values are NULLs when you change it, acl wouldn't be dumped since NULL <> value IS NULL. In general, these checks using subqueries looks complicated for me, hard to validate

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-22 Thread Alexander Korotkov
because it would significantly complicate code. It's not yes clear that traffic in this place is high enough to make such optimizations. Since v4 patch implements slightly different approach. Could you please test it? We need to check that this approach worth putting more efforts on it.

Re: [HACKERS] WIP: Access method extendability

2016-03-22 Thread Alexander Korotkov
blem of dependencies in DROP EXTENSION. > http://www.postgresql.org/message-id/26822.1414516...@sss.pgh.pa.us (Oct > 2014) > > And then Alexander posted this version, without any discussion that > evidenced that those old objections were overridden. What happened > here? Did somebo

Re: [HACKERS] dealing with extension dependencies that aren't quite 'e'

2016-03-21 Thread Alexander Korotkov
{ $$ = 'e'; } ; ... | ALTER EXTENSION name add_drop extension_dependency_type FUNCTION function_with_argtypes { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_FUNCTION; n->objname = $7->funcname; n->objargs = $7->funcargs; n->deptype = $5; $$ = (Node *)n; } I didn't try it. Probably it causes a grammar conflicts. In this case I don't insist on it. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] [PATCH] Phrase search ported to 9.6

2016-03-21 Thread Alexander Korotkov
; 'york' ) ) (1 row) select rewrite( ARRAY['moscow', keyword, sample] ) from test_tsquery; --- 461,469 (1 row) select rewrite('bar & new & qq & foo & york', 'select keyword, sample from test_tsquery'::text ); ! rewrite ! - ! ( 'nyc' | 'big' & 'appl' | 'new' & 'york' ) & 'citi' & 'foo' & ( 'bar' | 'qq' ) (1 row) select rewrite( ARRAY['moscow', keyword, sample] ) from test_tsquery; However, such reorderings look unclear and need motivation. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] improving GROUP BY estimation

2016-03-21 Thread Alexander Korotkov
ut to work very well even when > the > * number of distinct values is small. > */ > +1 Thank you for work on this patch. The formula you propose and explanation look great! -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] dealing with extension dependencies that aren't quite 'e'

2016-03-21 Thread Alexander Korotkov
= OBJECT_FUNCTION; > + n->objname = $7->funcname; > + n->objargs = $7->funcargs; > + n->deptype = 'x'; > $$ = (Node *)n; > } by introducing separate rule extension_depen

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-19 Thread Alexander Korotkov
On Sat, Mar 19, 2016 at 3:22 PM, Dilip Kumar wrote: > > On Mon, Mar 14, 2016 at 3:09 AM, Alexander Korotkov < > a.korot...@postgrespro.ru> wrote: > >> I've drawn graphs for these measurements. The variation doesn't look >> random here. TPS is going higher

Re: [HACKERS] Declarative partitioning

2016-03-19 Thread Alexander Korotkov
t; > MergeAppend when possible); > > Optimization of hash join when both tables are patitioned by join key. > > > > I'd like to validate that this development plan doesn't overlaps with > your > > plans. If out plans are not overlapping then le

[HACKERS] initdb: introduce PG_CMD_PRINTF intestead of PG_CMD_PRINTF{1,2,3}

2016-03-19 Thread Alexander Kuleshov
Hello all, The src/bin/initdb/initdb.c provides three macros to write data to cmdfd. All of these macro do the same, but with different amount of arguments for fprintf(). Attached patch introduces PG_CMD_PRINTF macro which will take set of variadic arguments via __VA_ARGS__ to replace the PG_CMD_

Re: [HACKERS] Declarative partitioning

2016-03-19 Thread Alexander Korotkov
.7. Links. [1] http://www.postgrespro.com/blog/pgsql/pg_pathman [2] http://akorotkov.github.io/blog/2016/03/04/pg_pathman-beta-release/ [3] http://akorotkov.github.io/blog/2016/03/14/pg_pathman-condition-processing/ -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] Background Processes and reporting

2016-03-15 Thread Alexander Korotkov
enough for testing of GUC controlled, off by default features. Then we can turn our conversation from theoretical thoughts to particular benchmarks which would be objective and convincing to everybody. Otherwise, let's just add these features to the list of unwanted functionality and close this question. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-13 Thread Alexander Korotkov
On Fri, Mar 11, 2016 at 7:08 AM, Dilip Kumar wrote: > > On Thu, Mar 10, 2016 at 8:26 PM, Alexander Korotkov < > a.korot...@postgrespro.ru> wrote: > >> I don't think we can rely on median that much if we have only 3 runs. >> For 3 runs we can only appl

Re: [HACKERS] PoC: Partial sort

2016-03-13 Thread Alexander Korotkov
amine this path more carefully next week. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company partial-sort-basic-7.patch Description: Binary data -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your su

Re: [HACKERS] Background Processes and reporting

2016-03-12 Thread Alexander Korotkov
On Sat, Mar 12, 2016 at 2:45 AM, Andres Freund wrote: > On 2016-03-12 02:24:33 +0300, Alexander Korotkov wrote: > > Idea of individual time measurement of every wait event met criticism > > because it might have high overhead [1]. > > Right. And that's actually one

[HACKERS] [PATCH] Use MemoryContextAlloc() in the MemoryContextAllocZero() and MemoryContextAllocZeroAligned()

2016-03-11 Thread Alexander Kuleshov
Hello all, Attached patch simplifies the MemoryContextAllocZero() and MemoryContextAllocZeroAligned(). The MemoryContextAllocZero() and MemoryContextAllocZeroAligned() functions does almost the same that MemoryContextAlloc() does. Additionally these functions fills allocated memory context with ze

Re: [HACKERS] Background Processes and reporting

2016-03-11 Thread Alexander Korotkov
t a quick scan of the thread doesn't > show authors of the wait events patch participating there. > > > > Can’t we think one more time about implementation provided by Ildus > > and Alexander here [3]? > > I don't think so. Afaics the proposed patch tried t

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-03-10 Thread Alexander Korotkov
s that confidence interval should be between lower and upper values. Since confidence intervals for master and patched versions are overlapping we can't conclude that expected TPS numbers are different. Dilip, could you do more runs? 10, for example. Using such statistics we would be able to conclude something. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

[HACKERS] utils/misc: Simplify search of end of argv in save_ps_display_args()

2016-03-10 Thread Alexander Kuleshov
Hello, Attached patch provides trivial simplification of the search of end of the argv[] area by replacing for() loop with calculation based on argc. diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c index 892a810..d8f2105 100644 --- a/src/backend/utils/misc/ps_s

Re: [HACKERS] WIP: Upper planner pathification

2016-03-09 Thread Alexander Korotkov
On Wed, Mar 9, 2016 at 5:47 PM, Tom Lane wrote: > Alexander Korotkov writes: > > I have a question about Sort path. AFAICS this question wasn't mentioned > in > > the upthread discussion. > > We're producing Sort plans in two ways: from explicit Sort paths

Re: [HACKERS] WIP: Upper planner pathification

2016-03-09 Thread Alexander Korotkov
plan only from explicit Sort path? Thus, MergeJoin path would add explicit children Sort paths. That would be more unified way. I ask about this from point of view of my "Partial Sort" patch. The absence of implicit sorts would help to make this patch more simple and clean. -

Re: [HACKERS] syslog configurable line splitting behavior

2016-03-04 Thread Alexander Korotkov
t; can toggle these behaviors. > Would it have any usage if we make PG_SYSLOG_LIMIT configurable (-1 for disable) instead of introducing boolean? -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] pg_resetxlog reference page reorganization

2016-03-04 Thread Alexander Korotkov
ther ref pages, with a normal options list. > Patch applies cleanly on head, documentation compiles with no problem. pg_resetxlog page definitely looks much better than it was before. I don't see any problems or issues with this patch. So, I mark it "Ready for committer". --

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-04 Thread Alexander Korotkov
On Fri, Mar 4, 2016 at 4:20 PM, Amit Kapila wrote: > On Fri, Mar 4, 2016 at 4:01 PM, Alexander Korotkov > wrote: > >> On Fri, Mar 4, 2016 at 7:05 AM, Amit Kapila >> wrote: >> >>> > I think the wait event types should be documented - and the wait >

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-04 Thread Alexander Korotkov
ve which type. Readability of this large table will be also improved. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] improving GROUP BY estimation

2016-03-03 Thread Alexander Korotkov
e that Mark means geometrical average, i.e. sqrt((small number) * (huge number)). -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] improving GROUP BY estimation

2016-03-03 Thread Alexander Korotkov
On Thu, Mar 3, 2016 at 7:35 PM, Tomas Vondra wrote: > On 03/03/2016 12:53 PM, Alexander Korotkov wrote: > >> I've assigned to review this patch. >> >> I've checked version estimate-num-groups-v2.txt by Mark Dilger. >> It applies to head cleanly, passes

Re: [HACKERS] improving GROUP BY estimation

2016-03-03 Thread Alexander Korotkov
umbers is negligible, especially because getting rid of this error would require way more computations. But it worth mentioning in comments though. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] The plan for FDW-based sharding

2016-03-02 Thread Alexander Korotkov
works. > > Alternately, you can just work on the individual FDW features, which > *everyone* thinks are a good idea, and when most of them are done, > FDW-based scaleout will be such an obvious solution that nobody will argue > with it. +1 Thank you, Josh. I think this is excellent summary for conversation about FDW-based sharding. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] The plan for FDW-based sharding

2016-03-02 Thread Alexander Korotkov
wever, other things are unclear. You can try to build full-featured prototype to convince people. Despite it would take some resources it will save more resources because it would save us from errors. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] The plan for FDW-based sharding

2016-03-02 Thread Alexander Korotkov
be really chance in this situation. Users could use extension right now. And then when after many years we finally implement the right design, they could migrate to in-core solution. But 5-10 years of fast FTS does matter. > I suspect that > a transaction manager API would end up similarly

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-02-29 Thread Alexander Korotkov
On Sat, Feb 27, 2016 at 2:44 AM, Andres Freund wrote: > On 2016-02-02 13:12:50 +0300, Alexander Korotkov wrote: > > On Tue, Feb 2, 2016 at 12:43 AM, Andres Freund > wrote: > > > > > On 2016-02-01 13:06:57 +0300, Alexander Korotkov wrote: > > > > On

Re: [HACKERS] Relation cache invalidation on replica

2016-02-26 Thread Alexander Korotkov
oesn't pick it. Assuming that in new session planner picks this index, it seems to be bug for me. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] The plan for FDW-based sharding

2016-02-24 Thread Alexander Korotkov
gt; I have nothing against particular FDW advances. However, it's unclear for me that FDW should be the only sharding approach. It's unproven that FDW can do work that Postgres XC/XL does. With FDW we can have some low-hanging fruits. That's good. But it's unclear we can have

Re: [HACKERS] about google summer of code 2016

2016-02-18 Thread Alexander Korotkov
reated wiki page for GSoC 2016. It contains unimplemented ideas from 2015 page. Now, GSoC accepting proposals from organizations. Typically, we have call for mentors in hackers mailing list in this period. Thom, do we apply this year? -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] Figures in docs

2016-02-17 Thread Alexander Lakhin
ore appropriate than having a single large XML, then we will propose a procedure to perform such conversion (that will result in corresponding mega patch). Best regards, Alexander Lakhin 17.02.2016 08:41, Tatsuo Ishii пишет: On Wed, Feb 17, 2016 at 4:17 AM, Tatsuo Ishii wrote: It seems the

Re: [HACKERS] Figures in docs

2016-02-17 Thread Alexander Lakhin
17.02.2016 09:17, Tatsuo Ishii wrote: >> Hi. >> >> In DocBook 4.2 sgml dtd, figure tag is supported already. >> that was implemented for multi output format. > Ok, there's no technical problems with figures then. MySQL docs has > some nice figures. I am jealous. The "figure" tag is just a placeho

Re: [HACKERS] Sequence Access Method WIP

2016-02-16 Thread Alexander Korotkov
On Sat, Jan 30, 2016 at 3:37 PM, Petr Jelinek wrote: > On 29 January 2016 at 23:59, Robert Haas wrote: > > On Fri, Jan 29, 2016 at 5:24 PM, Tom Lane wrote: > >> Alexander Korotkov writes: > >>> On Fri, Jan 29, 2016 at 6:36 PM, Alvaro Herrera < > a

Re: [HACKERS] [PATCH] Refactoring of LWLock tranches

2016-02-02 Thread Alexander Korotkov
On Tue, Feb 2, 2016 at 2:54 PM, Robert Haas wrote: > On Mon, Feb 1, 2016 at 3:47 AM, Alexander Korotkov > wrote: > > OK. This one looks good for me too. > > All right, I pushed both this and the other one as a single commit, > since they were so closely related and the

Re: [HACKERS] Fix KNN GiST ordering type

2016-02-02 Thread Alexander Korotkov
On Mon, Feb 1, 2016 at 7:31 PM, Alexander Korotkov < a.korot...@postgrespro.ru> wrote: > KNN GiST detects which type it should return by returning type of ordering > operator. > But it appears that type of sk_func is detected after it was replaced with > distance function. That

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-02-02 Thread Alexander Korotkov
On Tue, Feb 2, 2016 at 12:43 AM, Andres Freund wrote: > On 2016-02-01 13:06:57 +0300, Alexander Korotkov wrote: > > On Mon, Feb 1, 2016 at 11:34 AM, Alexander Korotkov < > > a.korot...@postgrespro.ru> wrote: > > >> ClientBasePatch > > >> 1

[HACKERS] Fix KNN GiST ordering type

2016-02-01 Thread Alexander Korotkov
9.5. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company fix-knn-gist-ordering-type.patch Description: Binary data -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-02-01 Thread Alexander Korotkov
not enough for some tranches. For instance, number of buffers could be easily more than 2^16. However, we could expose at least lower 16 bits. It would be at least something. Using this information user at least can make a conclusion like "It MIGHT be a high concurrency for single buffer content. Other way it is coincidence that a lot of different buffers have the same 16 lower bits.". Any thoughts? -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-02-01 Thread Alexander Korotkov
On Mon, Feb 1, 2016 at 11:34 AM, Alexander Korotkov < a.korot...@postgrespro.ru> wrote: > On Mon, Feb 1, 2016 at 7:05 AM, Dilip Kumar wrote: > >> >> On Sun, Jan 31, 2016 at 11:44 AM, Dilip Kumar >> wrote: >> >>> By looking at the results with scale f

Re: [HACKERS] [PATCH] Refactoring of LWLock tranches

2016-02-01 Thread Alexander Korotkov
On Mon, Feb 1, 2016 at 10:26 AM, Amit Kapila wrote: > On Sat, Jan 30, 2016 at 2:15 PM, Alexander Korotkov < > a.korot...@postgrespro.ru> wrote: > > > > On Sat, Jan 30, 2016 at 10:58 AM, Amit Kapila > wrote: > >> > >> On Fri, Jan 29, 2016 at 6:47 P

Re: [HACKERS] Proposal: Generic WAL logical messages

2016-02-01 Thread Alexander Korotkov
On Sat, Jan 30, 2016 at 11:58 AM, Simon Riggs wrote: > On 29 January 2016 at 21:11, Alexander Korotkov > wrote: > >> Hi, Petr! >> >> On Sat, Jan 23, 2016 at 1:22 AM, Petr Jelinek >> wrote: >> >>> here is updated version of this patch, call

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-02-01 Thread Alexander Korotkov
393151 > 64387339496830 > 128306412350610 > > Shared Buffer= 512MB > max_connections=150 > Scale Factor=300 > > ./pgbench -j$ -c$ -T300 -M prepared -S postgres > > ClientBasePatch > 11716916454 > 8108547105559

Re: [HACKERS] [PATCH] Refactoring of LWLock tranches

2016-01-30 Thread Alexander Korotkov
On Sat, Jan 30, 2016 at 10:58 AM, Amit Kapila wrote: > On Fri, Jan 29, 2016 at 6:47 PM, Robert Haas > wrote: > > > > On Fri, Jan 29, 2016 at 6:59 AM, Alexander Korotkov > > wrote: > > > On Thu, Jan 21, 2016 at 12:37 AM, Alvaro Herrera < > alvhe...@2ndquad

Re: [HACKERS] Optimizer questions

2016-01-29 Thread Alexander Korotkov
t; Seq Scan on t1 (cost=0.00..15406.00 rows=100 width=12) (actual time=0.012..78.828 rows=100 Planning time: 0.132 ms Execution time: 301.308 ms (12 rows) In this example LIMIT pushdown makes query 5 times faster. It would be very nice if optimizer make this automatically. -- Alexander

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-01-29 Thread Alexander Korotkov
532052 552148 > 128412755 478826 > 256 346701 372057 > Could you please re-run these tests few times? Just to be sure it's a reproducible regression with s=300 and not a statistical error. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] Proposal: Generic WAL logical messages

2016-01-29 Thread Alexander Korotkov
tures. Should we think more about naming? Does two kinds of generic records confuse people? -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] Sequence Access Method WIP

2016-01-29 Thread Alexander Korotkov
YPE INDEX or something > like that. > Ok! Let's nail down the syntax and I can integrate it into my createam patch. I would prefer "CREATE {INDEX | SEQUENCE | ... } ACCESS METHOD name HANDLER handler;", but I don't insist. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] [PATCH] Refactoring of LWLock tranches

2016-01-29 Thread Alexander Korotkov
ests. I also did small testing of replication slots in order to check that it works correctly. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] [PATCH] Refactoring of LWLock tranches

2016-01-29 Thread Alexander Korotkov
t, I have updated the docs to reflect the changes related > to new API's. > > Fe things to Note - > Some change is needed in LWLockCounter[1] if this goes after 2 > other patches (separate tranche for PGProcs and separate tranche > for ReplicationSlots). Also, LWLockAssig

Re: [HACKERS] [PATCH] Refactoring of LWLock tranches

2016-01-29 Thread Alexander Korotkov
body. +1 for dropping old API I don't think it's useful to have LWLocks without having shared memory. There is another thing I'd like extensions to be able to do. It would be nice if extensions could use dynamic shared memory instead of static. Then extensions could use shared memory without being in shared_preload_libraries. But if extension register DSM, then there is no way to tell other backends to use it for that extension. Also DSM would be deallocated when all backends detached from it. This it out of scope for this patch though. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] [PATCH] Refactoring of LWLock tranches

2016-01-29 Thread Alexander Korotkov
ll, but the other two have seen a > bit of discussion and evolution. Is anyone doing any more reviewing? I'd like to add another one: fixed tranche id for each SLRU. And I'm going to make review over others. -- Alexander Korotkov Postgres Professional: http://www.postg

Re: [HACKERS] PoC: Partial sort

2016-01-24 Thread Alexander Korotkov
sorted > > tuples into other nodes. > > That's cool, but I'm particularly interested in seeing Alexander get > back to this because it's an important project on its own. We should > really have this. > Thank you for your review and interest in this patch! I&#

Re: [HACKERS] PoC: Partial sort

2016-01-24 Thread Alexander Korotkov
Hi, Tomas! On Sat, Jan 23, 2016 at 3:07 PM, Tomas Vondra wrote: > On 10/20/2015 01:17 PM, Alexander Korotkov wrote: > >> On Fri, Oct 16, 2015 at 7:11 PM, Alexander Korotkov >> mailto:aekorot...@gmail.com>> wrote: >> >> On Sun, Jun 7, 2015 at 11:01

Re: [HACKERS] Optimizer questions

2016-01-05 Thread Alexander Korotkov
l to make it > better. > Hmm... Besides costing it would be nice to postpone calculation of expensive tlist functions after LIMIT. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] Commit fest status for 2015-11

2015-12-24 Thread Alexander Korotkov
thanks to Michael for doing the CF management work this time! > ​+1 ​Michael, thank you for the great job. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] Patch: pg_trgm: gin index scan performance for similarity search

2015-12-24 Thread Alexander Korotkov
se a more aggressive > upper bound: ntrue / (ntrue + nkeys - ntrue) or ntrue / nkeys. Attached is > a patch that changes this. > ​Good catch, thank you! The estimate in pg_trgm was not optimal. I think it would be good to add comment which would explicitly state why do we use this upper bound.

Re: [HACKERS] Fuzzy substring searching with the pg_trgm extension

2015-12-19 Thread Alexander Korotkov
commitfest: > https://commitfest.postgresql.org/8/448/ ​Great. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] statistics for array types

2015-12-18 Thread Alexander Korotkov
On Wed, Sep 16, 2015 at 8:01 PM, Alexander Korotkov < a.korot...@postgrespro.ru> wrote: > On Mon, Aug 24, 2015 at 8:26 PM, Jeff Janes wrote: > >> On Thu, Aug 20, 2015 at 6:00 PM, Tomas Vondra < >> tomas.von...@2ndquadrant.com> wrote: >> >>> Hi, >

[HACKERS] Proposal: custom compression methods

2015-12-13 Thread Alexander Korotkov
etr Korobeinikov who started work on this patch and sent me draft of proposal in Russian. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2015-12-11 Thread Alexander Korotkov
On Thu, Dec 10, 2015 at 9:26 AM, Amit Kapila wrote: > On Wed, Dec 9, 2015 at 2:17 PM, Alexander Korotkov < > a.korot...@postgrespro.ru> wrote: > >> On Tue, Dec 8, 2015 at 6:00 PM, Amit Kapila >> wrote: >> >>> On Tue, Dec 8, 2015 at 3:56 PM, Alexande

[HACKERS] Isolation of table creation

2015-12-11 Thread Alexander Korotkov
found. # select * from tmp; i --- (0 rows) # insert into tmp values (2); INSERT 0 1 # select * from tmp; i --- 2 (1 row) # commit; COMMIT Is it a bug? -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2015-12-09 Thread Alexander Korotkov
On Tue, Dec 8, 2015 at 6:00 PM, Amit Kapila wrote: > On Tue, Dec 8, 2015 at 3:56 PM, Alexander Korotkov < > a.korot...@postgrespro.ru> wrote: >> >> ​Agree. This patch need to be carefully verified. Current experiments >> just show that it is promising direction f

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2015-12-08 Thread Alexander Korotkov
On Tue, Dec 8, 2015 at 1:04 PM, Andres Freund wrote: > On 2015-12-08 12:53:49 +0300, Alexander Korotkov wrote: > > ​This is why atomic increment *could be* cheaper than loop over CAS and, > it > > worth having experiments. ​Another idea is that we can put arbitrary > logic

Re: [HACKERS] Use pg_rewind when target timeline was switched

2015-12-01 Thread Alexander Korotkov
ks fine as-is, and that's what Alexander and I agreed > on upthread. If there is something forgotten though, this may be the > fact that we do not mention in 9.5's documentation that pg_rewind can > *not* handle timeline switches. > ​However, we can add some explicit stat

Re: [HACKERS] Some questions about the array.

2015-11-11 Thread Alexander Korotkov
On Mon, Nov 9, 2015 at 8:23 PM, Pavel Stehule wrote: > 2015-11-09 17:55 GMT+01:00 Alexander Korotkov : > >> On Mon, Nov 9, 2015 at 4:53 PM, Pavel Stehule >> wrote: >> >>> 2015-11-09 14:44 GMT+01:00 YUriy Zhuravlev : >>> >>>> On Monday 09

Re: [HACKERS] Some questions about the array.

2015-11-09 Thread Alexander Korotkov
stead [:] for zero array access. >> The function is the solution half. >> > > It isn't solution. The any syntax/behave change have to have stronger > motivation. We had so talk about it 20 years ago :( > Assuming array[~n] has a current meaning, could we give a try to ne

Re: [HACKERS] Summary of Vienna sharding summit, new TODO item

2015-11-07 Thread Alexander Korotkov
external sharding solutions as well. > > > > Is this acceptable? > > Added to TODO. Great, thank you, Bruce! -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] WIP: Rework access method interface

2015-11-03 Thread Alexander Korotkov
in exposing CREATE/ > ALTER OP CLASS's internal working representation to the verifiers. > I'm OK with validating opclass directly by system catalog, i.e. looping over SearchSysCacheList results. Teodor was telling me something similar personally. I'll also try to rearrange heade

Re: [HACKERS] WIP: Access method extendability

2015-11-02 Thread Alexander Korotkov
. GenericXLogFinish swaps the data between page copy and page itself. That allow us to avoid critical section in used code. -- Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company generic-xlog.4.patch.gz Description: GNU Zip compressed data crea

[HACKERS] [PATCH] we have added support for box type in SP-GiST index

2015-10-31 Thread Alexander Lebedev
Hello, Hacker. * [PATCH] add a box index to sp-gist We have extended sp-gist with an index that keeps track of boxes We have used ideas underlying sp-gist range implementation to represent 2D boxes as points in 4D space. We use quad tree analogue, but in 4-dimensional space. We call thi

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2015-10-30 Thread Alexander Korotkov
Hi! On Fri, Oct 30, 2015 at 5:12 PM, Andres Freund wrote: > On 2015-10-30 16:28:22 +0300, Alexander Korotkov wrote: > > pinunpin-cas-original-fix.patch is just original patch by Andres Freund > > with fixed bug which causes hang. > > Performance comparison on 72-cores Int

<    1   2   3   4   5   6   7   8   9   10   >