Constraint's NO INHERIT option is ignored in CREATE TABLE LIKE statement

2020-02-19 Thread Ildar Musin
Hi hackers, My colleague Chris Travers discovered something that looks like a bug. Let's say we have a table with a constraint that is declared as NO INHERIT. CREATE TABLE test ( x INT CHECK (x > 0) NO INHERIT ); \d test Table "public.test" Column | Type | Collation |

Compressed pluggable storage experiments

2019-10-10 Thread Ildar Musin
Hi hackers, I've been experimenting with pluggable storage API recently and just feel like I can share my first experience. First of all it's great to have this API and that now community has the opportunity to implement alternative storage engines. There are a few applications that come to mind

Duplicated LSN in ReorderBuffer

2019-06-25 Thread Ildar Musin
Hi hackers, I believe we found a bug in logical decoding. It only occures with casserts enabled. It was originally discovered and reproduced by Murat Kabilov and Ildus Kurbangaliev. Here is the stacktrace we've got: #0 0x7facc66ef82f in raise () from /usr/lib/libc.so.6 #1

Re: [HACKERS] Transactions involving multiple postgres foreign servers, take 2

2019-01-29 Thread Ildar Musin
Hello, The patch needs rebase as it doesn't apply to the current master. I applied it to the older commit to test it. It worked fine so far. I found one bug though which would cause resolver to finish by timeout even though there are unresolved foreign transactions in the list. The

Possibly redundant context switch in postgres_fdw

2018-10-18 Thread Ildar Musin
o(oldcontext); } is redundant since we should already be in `ecxt_per_tuple_memory` context according to `ForeignNext()`. Do I miss some hidden purpose? If not here is a patch that removes it. Regards, Ildar Musin diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres

Re: hostorder and failover_timeout for libpq

2018-09-19 Thread Ildar Musin
Hello Surafel, On Fri, Sep 14, 2018 at 2:03 PM Surafel Temesgen wrote: > Hey , > Here are a few comment. > + xreflabel="failover_timeout"> > Here's a typo: ="libpq-connect-falover-timeout" > + {"failover_timeout", NULL, NULL, NULL, > + "Failover Timeout", "", 10, > Word

Re: MAP syntax for arrays

2018-05-08 Thread Ildar Musin
On 08.05.2018 17:15, Peter Eisentraut wrote: On 5/8/18 09:19, Chapman Flack wrote: On 05/08/2018 08:57 AM, Ildar Musin wrote: select map (pow(2, x) - 1 for x in array[1,2,3,4,5]); I wonder how efficient an implementation would be possible strictly as a function, without grammar changes

Re: MAP syntax for arrays

2018-05-08 Thread Ildar Musin
On 08.05.2018 15:49, Ildar Musin wrote: select map (pow(x, 2) - 1 for x in array[1,2,3]); Sorry, the example should be: select map (pow(2, x) - 1 for x in array[1,2,3,4,5]); ?column? --- {1,3,7,15,31} (1 row) -- Ildar Musin i.mu...@postgrespro.ru

Re: MAP syntax for arrays

2018-05-08 Thread Ildar Musin
instead of single function call). So now user can specify a placeholder representing one element of the array and use it in the expressions. Like following: select map (pow(x, 2) - 1 for x in array[1,2,3]); ?column? --- {1,3,7,15,31} (1 row) -- Ildar Musin i.mu...@postgrespro.r

MAP syntax for arrays

2018-05-04 Thread Ildar Musin
| 43.622554 100 | 7.693000 |5.325805 Apparently map is more efficient for small arrays. And as the size of array increases the difference decreases. I'll be glad to any input from the community. Thanks! -- Ildar Musin i.mu...@postgrespro.ru diff --git a/src/backend/executor

hostorder and failover_timeout for libpq

2018-04-18 Thread Ildar Musin
Victor Wagner's original patch. I'll be glad to see any comments and suggestions. Thanks! [1] https://www.postgresql.org/message-id/flat/20150818041850.GA5092%40wagner.pp.ru -- Ildar Musin i.mu...@postgrespro.ru diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 800e68a

Re: using index or check in ALTER TABLE SET NOT NULL

2018-03-15 Thread Ildar Musin
to me, it applies and compiles cleanly, docs compiles as well, tests pass. Changed status to Ready for Committer. -- Ildar Musin i.mu...@postgrespro.ru

Re: General purpose hashing func in pgbench

2018-03-14 Thread Ildar Musin
Hello Teodor, On 07.03.2018 16:21, Ildar Musin wrote: Turned out that the only big-endian machine I could run test on is out of order. I finally managed to perform this test on sparc v9 machine which is 64 bit big-endian architecture. I run pgbench script (see previous message

Re: Failed to request an autovacuum work-item in silence

2018-03-12 Thread Ildar Musin
at matters is whether the request was satisfied/successful. Except for those two points everything is fine and works as expected. -- Ildar Musin i.mu...@postgrespro.ru

Re: Failed to request an autovacuum work-item in silence

2018-03-08 Thread Ildar Musin
utovacuum work item "%s" for "%s" failed Thanks! -- Ildar Musin Postgres Professional: http://www.postgrespro.com Russian Postgres Company

Re: General purpose hashing func in pgbench

2018-03-07 Thread Ildar Musin
psql postgres -c "copy abc to '/tmp/hash_results.csv'" Thanks! -- Ildar Musin i.mu...@postgrespro.ru hash_init.sql Description: application/sql hash_run.sql Description: application/sql diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml index 5f28023..f07d

Re: using index or check in ALTER TABLE SET NOT NULL

2018-03-06 Thread Ildar Musin
onstraint on test_a attribute by existed constraints <<<< full scan was skipped! ALTER TABLE -- Ildar Musin i.mu...@postgrespro.ru

Re: General purpose hashing func in pgbench

2018-03-06 Thread Ildar Musin
ne with strict alignment (Sparc). Thanks! -- Ildar Musin i.mu...@postgrespro.ru

Re: using index or check in ALTER TABLE SET NOT NULL

2018-03-05 Thread Ildar Musin
be useful to set client_min_messages to 'debug1' before setting "NOT NULL" attribute for a column. In this case you can tell for sure that NotNullImpliedByRelConstraints() returned true (i.e. your code actually did the job) as the special debug message is printed to the log. Thanks!

Re: Proposal: partition pruning by secondary attributes

2018-02-09 Thread Ildar Musin
On 08.02.2018 21:01, Andres Freund wrote: On 2018-02-08 14:48:34 -0300, Alvaro Herrera wrote: Ildar Musin wrote: The idea is to store min and max values of secondary attributes (like 'id' in the example above) for each partition somewhere in catalog and use it for partition pruning along

Proposal: partition pruning by secondary attributes

2018-02-08 Thread Ildar Musin
are monotonically increase or decrease, but would be unhelpful if they are scattered, or if table wasn't partitioned by range. I wanted to ask community's opinion would it be worth considering. Thanks! -- Ildar Musin i.mu...@postgrespro.ru

Re: [HACKERS] Custom compression methods

2018-01-29 Thread Ildar Musin
should benefit from cmdrop method, but it doesn't test it either yet). I think I did what I could and so passing this patch to committers for the review. Changed status to "Ready for committer". [1] https://github.com/postgrespro/jsonbd -- Ildar Musin i.mu...@postgrespro.ru

Re: General purpose hashing func in pgbench

2018-01-29 Thread Ildar Musin
On 29.01.2018 15:03, Fabien COELHO wrote: Patch applies, compiles, pgbench & global "make check" ok, doc built ok. Ok for me, switched to "Ready". Thank you for the thorough review! -- Ildar Musin i.mu...@postgrespro.ru

Re: General purpose hashing func in pgbench

2018-01-27 Thread Ildar Musin
he Assert(0) as an internal error that cannot happen. > > I'd suggest to compact the execution code by declaring int64 variable > and coerce to int in one go, like the integer bitwise functions. I'm > in favor to keeping them in their own case and not reuse this one. > I did everything

Re: [HACKERS] Custom compression methods

2018-01-26 Thread Ildar Musin
leStmt declaration which doesn't make sense in this patch. 9. Comments. Again, they should be read by a native speaker. So just a few suggestions: toast_prepare_varlena() - comment needed invalidate_amoptions_cache() - comment format doesn't match other functions in the file In htup_details.h:

Re: [HACKERS] Custom compression methods

2018-01-25 Thread Ildar Musin
Hello Ildus, On 23.01.2018 16:04, Ildus Kurbangaliev wrote: On Mon, 22 Jan 2018 23:26:31 +0300 Ildar Musin <i.mu...@postgrespro.ru> wrote: Thanks for review! Attached new version of the patch. Fixed few bugs, added more documentation and rebased to current master. You need to

Re: General purpose hashing func in pgbench

2018-01-25 Thread Ildar Musin
nless set by the command-line -D option." ISTM that the Automatic Variable table should be in alphabetical order. Updated the documentation. Thanks! -- Ildar Musin i.mu...@postgrespro.ru diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml index 3dd492c

Re: [HACKERS] Custom compression methods

2018-01-22 Thread Ildar Musin
u would kill two birds with one stone: it still provides sufficient infrastructure to catch those events (and it something postgres already has for different kinds of ddl commands) and it would be easier to test. Thanks! [1] https://github.com/zilder/pg_lz4 -- Ildar Musin Postgres Professional: http:/

Re: General purpose hashing func in pgbench

2018-01-17 Thread Ildar Musin
ll. > For the document example, I'd use larger values for the random & > modulo, eg 1 and 100. The drawback is that zipfian does a > costly computation of the generalized harmonic number when the > parameter is lower than 1.0. For cities, the parameter found by Zipf &g

Re: General purpose hashing func in pgbench

2018-01-16 Thread Ildar Musin
with some refactoring. The second part introduces random_seed variable as you proposed. I didn't do the executor simplification thing yet because I'm a little concerned about inventive users, who may want to change random_seed variable in runtime (which is possible since pgbench doesn't have read

Re: General purpose hashing func in pgbench

2018-01-12 Thread Ildar Musin
Hello Fabien, 11/01/2018 19:21, Ildar Musin пишет: > > 10/01/2018 21:42, Fabien COELHO пишет: >> Hmm. I do not think that we should want a shared seed value. The seed >> should be different for each call so as to avoid undesired >> correlations. If wanted, correlation co

Re: General purpose hashing func in pgbench

2018-01-11 Thread Ildar Musin
g: \set x random(1, 100) \set h1 hash(:x) \set h2 hash(:x)  -- will have different seed from h1 so that different instances of hash function within one script would have different seeds. Yes, that is a good idea, I can do that. -- Ildar Musin Postgres Professional: http://www.postgrespro.com Russian Postgres Company

Re: General purpose hashing func in pgbench

2018-01-11 Thread Ildar Musin
r each call so as to avoid undesired > correlations. If wanted, correlation could be obtained by using an > explicit identical seed. Probably I'm missing something but I cannot see the point. If we change seed on every invokation then we get uniform-like distribution (see attached image). And we don

Re: General purpose hashing func in pgbench

2018-01-10 Thread Ildar Musin
10/01/2018 16:35, Ildar Musin пишет: > 09/01/2018 23:11, Fabien COELHO пишет: >> Hello Ildar, >> >>> Sorry for a long delay. I've added hash() function which is just an >>> alias for murmur2. I've also utilized variable arguments feature from >>> least()

Re: General purpose hashing func in pgbench

2018-01-09 Thread Ildar Musin
s a hack. Should we probably add some infrastructure for optional arguments? Docs and tests are on their way. Thanks! -- Ildar Musin Postgres Professional: http://www.postgrespro.com Russian Postgres Company diff --git a/src/bin/pgbench/exprparse.y b/src/bin/pgbench/exprparse.y index 2649

Re: General purpose hashing func in pgbench

2017-12-25 Thread Ildar Musin
hould be used. > Just curious, which algorithm are you intended to choose? -- Ildar Musin Postgres Professional: http://www.postgrespro.com Russian Postgres Company

Re: General purpose hashing func in pgbench

2017-12-25 Thread Ildar Musin
revent attacks with crafted input data. How can it be useful in benchmarking? Unless it shows superior performance and randomization. -- Ildar Musin Postgres Professional: http://www.postgrespro.com Russian Postgres Company

Re: General purpose hashing func in pgbench

2017-12-22 Thread Ildar Musin
d not something someone would ever want to change; it appears in just a single function. So I'd better leave it the way it is. Actually I was thinking to do the same to fnv1a too : ) -- Ildar Musin Postgres Professional: http://www.postgrespro.com Russian Postgres Company

Re: General purpose hashing func in pgbench

2017-12-21 Thread Ildar Musin
ted anyway. > You are right, I've submitted the patch to upcoming commitfest. Thanks! -- Ildar Musin Postgres Professional: http://www.postgrespro.com Russian Postgres Company