Re: [HACKERS] Aggregates push-down to partitions

2017-11-09 Thread Maksim Milyutin
this feature? Maybe in this thread[1] your described problem are solved through introducing Parallel Append node? 1. https://www.postgresql.org/message-id/CAJ3gD9dy0K_E8r727heqXoBmWZ83HwLFwdcaSSmBQ1%2BS%2BvRuUQ%40mail.gmail.com -- Regards, Maksim Milyutin -- Sent via pgsql-hackers mai

Re: [HACKERS] Proposal: Local indexes for partitioned table

2017-10-07 Thread Maksim Milyutin
, we can specify name for each concrete index while recreating a whole hierarchy. -- Regards, Maksim Milyutin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] Proposal: Local indexes for partitioned table

2017-10-06 Thread Maksim Milyutin
Vi3a%2BsRV6nBpg204w7%3DL8MwPXVvYBFo1uM1Q%40mail.gmail.com -- Regards, Maksim Milyutin

Re: [HACKERS][BUG] Cache invalidation for queries that contains const of temporary composite type

2017-10-03 Thread Maksim Milyutin
composite type. On November commitfest I'll lay out patch that covers your case. -- Regards, Maksim Milyutin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS][BUG] Cache invalidation for queries that contains const of temporary composite type

2017-10-02 Thread Maksim Milyutin
t the following message: ERROR:  cached plan must not change result type I don't know whether it's right behavior. Anyhow your point is a good motivation to experiment and investigate different scenarios of work with cached plan that depends on non-stable type. Thanks for that. -- Regards, Maksim Milyutin

Re: [HACKERS][BUG] Cache invalidation for queries that contains const of temporary composite type

2017-10-02 Thread Maksim Milyutin
On 26.09.2017 23:25, Maksim Milyutin wrote: 25.09.17 20:50, Maksim Milyutin wrote: I have found out the problem when try to sequentially call the function that casts constant to composite type of temporary table that is deleted ateach transaction termination (i.e. at each function call

Re: [HACKERS] Add support for tuple routing to foreign partitions

2017-10-02 Thread Maksim Milyutin
in src/backend/executor/execMain.c -- Regards, Maksim Milyutin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] Partitions: \d vs \d+

2017-09-29 Thread Maksim Milyutin
something. Anyhow, we have to protect ourselves from empty output from *pg_get_partition_constraintdef*. And printing *No partition constraint* would be good point to start to examine why we didn't get any constraint definition. -- Regards, Maksim Milyutin

Re: [HACKERS] Partitions: \d vs \d+

2017-09-28 Thread Maksim Milyutin
On 28.09.2017 16:29, Jesper Pedersen wrote: On 09/28/2017 09:19 AM, Maksim Milyutin wrote: E.g. "No partition constraint" vs. "Partition constraint: satisfies_hash_partition(...)". I also noticed ambiguity in printing "No partition constraint" in non-verbose

Re: [HACKERS] Partitions: \d vs \d+

2017-09-28 Thread Maksim Milyutin
for partition tables regardless of the type of partition. Attached small patch removes any output about partition constraint in non-verbose mode. -- Regards, Maksim Milyutin diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index d22ec68..b301219 100644 --- a/src/bin/psql/describe

Re: [HACKERS][BUG] Cache invalidation for queries that contains const of temporary composite type

2017-09-26 Thread Maksim Milyutin
25.09.17 20:50, Maksim Milyutin wrote: I have found out the problem when try to sequentially call the function that casts constant to composite type of temporary table that is deleted ateach transaction termination (i.e. at each function call completion). For example, we have the following

Re: [HACKERS] Repetitive code in RI triggers

2017-09-26 Thread Maksim Milyutin
On 19.09.2017 11:09, Daniel Gustafsson wrote: Removing reviewer Maksim Milyutin from patch entry due to inactivity and community account email bouncing. Maksim: if you are indeed reviewing this patch, then please update the community account and re-add to the patch entry. cheers ./daniel

[HACKERS][BUG] Cache invalidation for queries that contains const of temporary composite type

2017-09-25 Thread Maksim Milyutin
use** the statement of this query doesn't have any dependency from the 'tbl' relation (/relationOids/ list of /CachedPlanSource/ struct). Attached patch resolves this problem by adding dependency from relation upon detection Const expression of composite type of that relation. -- Regards, Maksim Milyut

Re: [HACKERS] auto_explain : log queries with wrong estimation

2017-08-24 Thread Maksim Milyutin
(and segfault without). Instrumentation is initialized only with analyze (log_analyze is true)[1] Is there a simple way to get ntuples? It's interesting question. In one's time I didn't find any way to get the amount of tuples emitted from a node. 1. contrib/auto_explain/auto_explain.c:221 -- Regards, Maksim Milyutin

Re: [HACKERS] Proposal: Local indexes for partitioned table

2017-08-10 Thread Maksim Milyutin
10.08.17 23:01, Robert Haas wrote: On Wed, Apr 19, 2017 at 5:25 AM, Maksim Milyutin <m.milyu...@postgrespro.ru> wrote: Ok, thanks for the feedback. Then I'll use a new relkind for local partitioned index in further development. Any update on this? I'll continue to work soon. Sorry

Re: [HACKERS] [PATCH] New command to monitor progression of long running queries

2017-04-19 Thread Maksim Milyutin
On 19.04.2017 17:13, Remi Colinet wrote: Maksim, 2017-04-18 20:31 GMT+02:00 Maksim Milyutin <m.milyu...@postgrespro.ru <mailto:m.milyu...@postgrespro.ru>>: On 18.04.2017 17:39, Remi Colinet wrote: Regarding the queryDesc state of SQL query upon receiving a

Re: [HACKERS] Proposal: Local indexes for partitioned table

2017-04-19 Thread Maksim Milyutin
On 19.04.2017 11:42, Ashutosh Bapat wrote: On Tue, Apr 18, 2017 at 4:43 PM, Maksim Milyutin <m.milyu...@postgrespro.ru> wrote: Local partitioned indexes can be recognized through the check on the relkind of table to which the index refers. Something like this: heap = relatio

Re: [HACKERS] [PATCH] New command to monitor progression of long running queries

2017-04-18 Thread Maksim Milyutin
runtime statistics (data in the structure 'Instrumentation') to achieve the printing state of running query. 1. https://www.postgresql.org/message-id/24182.1472745492%40sss.pgh.pa.us 2. https://github.com/postgrespro/pg_query_state/blob/master/runtime_explain.patch -- Maksim Milyutin

Re: [HACKERS] [PATCH] New command to monitor progression of long running queries

2017-04-18 Thread Maksim Milyutin
1. https://github.com/postgrespro/pg_query_state 2. https://www.postgresql.org/message-id/dbfb1a42-ee58-88fd-8d77-550498f52bc5%40postgrespro.ru 3. https://www.postgresql.org/message-id/24182.1472745492%40sss.pgh.pa.us -- Maksim Milyutin Postgres Professional: http://www.postgrespro.com

Re: [HACKERS] Proposal: Local indexes for partitioned table

2017-04-18 Thread Maksim Milyutin
On 18.04.2017 13:08, Amit Langote wrote: Hi, Hi, Amit! On 2017/04/17 23:00, Maksim Milyutin wrote: Ok, thanks for the note. But I want to discuss the relevancy of introduction of a new relkind for partitioned index. I could to change the control flow in partitioned index creation

Re: [HACKERS] Proposal: Local indexes for partitioned table

2017-04-17 Thread Maksim Milyutin
On 10.04.2017 14:20, Robert Haas wrote: On Tue, Apr 4, 2017 at 12:10 PM, Maksim Milyutin <m.milyu...@postgrespro.ru> wrote: 1. I have added a new relkind for local indexes named RELKIND_LOCAL_INDEX (literal 'l'). Seems like it should maybe be RELKIND_PARTITIONED_INDEX. There's n

Re: [HACKERS] Proposal: Local indexes for partitioned table

2017-04-10 Thread Maksim Milyutin
On 10.04.2017 13:46, Greg Stark wrote: On 4 April 2017 at 17:10, Maksim Milyutin <m.milyu...@postgrespro.ru> wrote: 3. As I noticed early pg_depend table is used for cascade deleting indexes on partitioned table and its children. I also use pg_depend to determine relationship between

Re: [HACKERS] Declarative partitioning - another take

2017-04-07 Thread Maksim Milyutin
On 07.04.2017 13:05, Etsuro Fujita wrote: On 2016/12/14 16:20, Etsuro Fujita wrote: On 2016/12/09 19:46, Maksim Milyutin wrote: I would like to work on two tasks: - insert (and eventually update) tuple routing for foreign partition. - the ability to create an index on the parent and have all

Re: [HACKERS] Proposal: Local indexes for partitioned table

2017-04-04 Thread Maksim Milyutin
On 01.03.2017 13:53, Maksim Milyutin wrote: Hi hackers! As I've understood from thread [1] the main issue of creating local indexes for partitions is supporting REINDEX and DROP INDEX operations on parent partitioned tables. Furthermore Robert Haas mentioned the problem of creating index on key

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-27 Thread Maksim Milyutin
rel->rd_rel->relkind != RELKIND_FOREIGN_TABLE && + rel->rd_rel->relkind != RELKIND_PARTITIONED_TABLE) { RelationDropStorage(rel); } -- Maksim Milyutin Postgres Professional: http://www.postgrespro.com Russian Postgres Company

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-23 Thread Maksim Milyutin
is caught through if-statement [1] I think it is not safe. My patch fixes this issue. 1. src/backend/storage/smgr/md.c:1385 -- Maksim Milyutin Postgres Professional: http://www.postgrespro.com Russian Postgres Company diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index

Re: [HACKERS] Proposal: Local indexes for partitioned table

2017-03-02 Thread Maksim Milyutin
global index on partitioned table apart from the case when the index key are the same as partitioning key (or index comprises partitioning key in general). Thanks for your comment. I'll try to propose the first patches as soon as possible. -- Maksim Milyutin Postgres Professional: http

Re: [HACKERS] [POC] hash partitioning

2017-03-01 Thread Maksim Milyutin
. But IMO it's not flexible case. It would be a good thing if a regular table could be partitioned through separate command. Then your idea would not be restrictive. -- Maksim Milyutin Postgres Professional: http://www.postgrespro.com Russian Postgres Company -- Sent via pgsql-hackers

[HACKERS] Proposal: Local indexes for partitioned table

2017-03-01 Thread Maksim Milyutin
+f7xef4w_e2g3xxdmnsnzmzjuinhrco...@mail.gmail.com 2. https://www.postgresql.org/message-id/2b0d42f2-3a53-763b-c9c2-47139e4b1c2e%40lab.ntt.co.jp -- Maksim Milyutin Postgres Professional: http://www.postgrespro.com Russian Postgres Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make

Re: [HACKERS] Declarative partitioning - another take

2016-12-09 Thread Maksim Milyutin
API has to be improved. As for the extended index support, it doesn't look like a super-hard task. -- Maksim Milyutin Postgres Professional: http://www.postgrespro.com Russian Postgres Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your

Re: [HACKERS] [WIP] Patches to enable extraction state of query execution from external session

2016-09-02 Thread Maksim Milyutin
01.09.2016 18:58, Tom Lane пишет: Maksim Milyutin <m.milyu...@postgrespro.ru> writes: On Tue, Aug 30, 2016 at 9:34 AM, Maksim Milyutin <m.milyu...@postgrespro.ru <mailto:m.milyu...@postgrespro.ru>> wrote: Yes, but the problem is that nothing gives you the guarantee that at the

Re: [HACKERS] [WIP] Patches to enable extraction state of query execution from external session

2016-09-01 Thread Maksim Milyutin
On Tue, Aug 30, 2016 at 9:34 AM, Maksim Milyutin <m.milyu...@postgrespro.ru <mailto:m.milyu...@postgrespro.ru>> wrote: On Mon, Aug 29, 2016 at 5:22 PM, maksim <m.milyu...@postgrespro.ru <mailto:m.milyu...@postgrespro.ru> <mailto:m

Re: [HACKERS] [WIP] Patches to enable extraction state of query execution from external session

2016-08-31 Thread Maksim Milyutin
On 2016-08-30 11:22:43 +0300, Maksim Milyutin wrote: Hi, On 2016-08-29 18:22:56 +0300, maksim wrote: Now I complete extension that provides facility to see the current state of query execution working on external session in form of EXPLAIN ANALYZE output. This extension works on 9.5 version

Re: [HACKERS] [WIP] Patches to enable extraction state of query execution from external session

2016-08-30 Thread Maksim Milyutin
after query execution and asserts under InstEndLoop(). My patch releases this problem and rewrite formulas for statistic parameters appropriate to running queries without affecting regular EXPLAIN outputs. -- Maksim Milyutin Postgres Professional: http://www.postgrespro.com Russian Postgres C

Re: [HACKERS] [WIP] Patches to enable extraction state of query execution from external session

2016-08-30 Thread Maksim Milyutin
ates whether *ExplainQuery* is called for running query. Also I complement explain output, you can see details in README.md in repository. -- Maksim Milyutin Postgres Professional: http://www.postgrespro.com Russian Postgres Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@po