Commit Graph

3258 Commits (adaptiveExecutor_DestReceiver)

Author SHA1 Message Date
SaitTalhaNisanci f4828f547f wip 2020-02-13 14:52:05 +03:00
Hadi Moshayedi fc1fe0244e
Merge pull request #3488 from citusdata/fix-typos
Fix typos noticed while reading through code trying to understand HAVING
2020-02-11 15:40:13 -08:00
Philip Dubé 3a906b8210 Fix typos noticed while reading through code trying to understand HAVING 2020-02-11 19:55:10 +00:00
Onur Tirtir ab0b49db82
fix uninitialized variable warning (#3483) 2020-02-11 15:44:31 +01:00
Onur Tirtir e660f4f854 Add changelog entry for 9.2.0 (#3463) 2020-02-10 11:03:39 +03:00
Onur Tirtir 39df51e903
Introduce objects to dist. infrastructure when updating Citus (#3477)
Mark existing objects that are not included in distributed object infrastructure
in older versions of Citus (but now should be) as distributed, after updating
Citus successfully.
2020-02-07 18:07:59 +03:00
Nils Dijk d5433400f9
Fix: Unnecessary repartition on joins with more than 4 tables (#3473)
DESCRIPTION: Fix unnecessary repartition on joins with more than 4 tables

In 9.1 we have introduced support for all CH-benCHmark queries by widening our definitions of joins to include joins with expressions in them. This had the undesired side effect of Q5 regressing on its plan by implementing a repartition join.

It turned out this regression was not directly related to widening of the join clause, nor the schema employed by CH-benCHmark. Instead it had to do with 4 or more tables being joined in a chain. A chain meaning:

```sql
SELECT * FROM a,b,c,d WHERE a.part = b.part AND b.part = c.part AND ....
```

Due to how our join order planner was implemented it would only keep track of 1 of the partition columns when comparing if the join could be executed locally. This manifested in a join chain of 4 tables to _always_ be executed as a repartition join. 3 tables joined in a chain would have the middle table shared by the two outer tables causing the local join possibility to be found.

With this patch we keep a  unique list (or set) of all partition columns participating in the join. When a candidate table is checked for a possibility to execute a local join it will check if there is any partition column in that set that matches an equality join clause on the partition column of the candidate table.

By taking into account all partition columns in the left relation it will now find the local join path on >= 4 tables joined in a chain. 

fixes: #3276
2020-02-06 15:07:07 +01:00
Philip Dubé 345455d765
Merge pull request #3461 from citusdata/fix-adaptive-repartition-join-leak
Fix adaptive repartition join leak
2020-02-05 17:43:23 +00:00
Philip Dubé ecad4aa5e6 Fill in jobIdList field of DistributedExecution
Pass down jobIdList from ExecuteTasksInDependencyOrder

Also clean up comment for ExecuteTaskListOutsideTransaction
2020-02-05 17:32:22 +00:00
Philip Dubé c252811884 dont: don't, wont: won't, acylic: acyclic 2020-02-05 17:32:22 +00:00
Halil Ozan Akgül fff3866844
Merge pull request #3472 from citusdata/grant_on_public_schema
Fixes the bug of grants on public schema propagation
2020-02-05 18:40:45 +03:00
Halil Ozan Akgul 8ce4f20061 Fixes the bug of grants on public schema propagation 2020-02-05 18:05:58 +03:00
SaitTalhaNisanci 89dc7d5e41
remove outdated information in citus upgrade readme (#3471) 2020-02-05 13:31:02 +03:00
Marco Slot 8c972dc614
Merge pull request #3470 from citusdata/insert_select_issue
Rename discarded target list items in repartitioned INSERT/SELECT
2020-02-05 11:21:05 +01:00
Marco Slot 64ca5c9acb Add additional INSERT..SELECT repartition tests 2020-02-05 11:06:44 +01:00
Hadi Moshayedi 9dd14fa90d Rename discarded target list items in repartitioned INSERT/SELECT 2020-02-05 11:06:44 +01:00
Önder Kalacı 1aa89d3242
Merge pull request #3467 from citusdata/fix_crash_numeric
Improve single hash-repartitioning with numeric (or non-int) types
2020-02-05 09:12:41 +01:00
Onder Kalaci c7e2309f4c Improve single hash-repartitioning with numeric (or non-int) types
We used to treat the shard interval array that we passed as numeric[].
However, it should be int[], as the shard ranges are int[].
2020-02-04 20:30:04 +01:00
Hadi Moshayedi 3826e81056
Merge pull request #3460 from citusdata/fix_permissions
Create merge task temporary schemas with current user
2020-02-04 10:05:02 -08:00
Hadi Moshayedi bc1a800f70 Use current user for repartition join temp schemas.
Otherwise when using a less privileged user we might get
errors when trying to create the schema.
2020-02-04 09:48:20 -08:00
Hadi Moshayedi 13d27cb280
Merge pull request #3451 from citusdata/insert_select_partitioned_joins_2
Don't error out when subquery in INSERT/SELECT is not router plannable.
2020-02-03 13:29:04 -08:00
Hadi Moshayedi 890e23e734 Update multi_insert_select_non_pushable_queries 2020-02-03 13:13:30 -08:00
Hadi Moshayedi 5818bcd27e Update with_dml 2020-02-03 13:13:30 -08:00
Hadi Moshayedi 46f60e1ac0 Update multi_insert_select_conflict 2020-02-03 13:13:30 -08:00
Hadi Moshayedi 05f58c9ec5 Update multi_insert_select 2020-02-03 13:13:30 -08:00
Hadi Moshayedi 264530311a Don't use distributed insert/select for repartitioned joins 2020-02-03 13:13:30 -08:00
Marco Slot 2e8c118a8f
Make connection assignment more liberal after parallel join wit… (#3456)
Make connection assignment more liberal after parallel join with reference table
2020-02-03 20:11:20 +01:00
Onder Kalaci 8be1b0112d Add failure test for parallel reference table join 2020-02-03 19:35:07 +01:00
Marco Slot be77d3304f Fixup 2020-02-03 11:59:55 +01:00
Marco Slot a6bd6c657e Add tests that exercise parallel reference table join logic 2020-02-03 11:54:29 +01:00
Marco Slot b0fd6aa006 If reference tables was read over multiple connections, do not assign connection 2020-02-03 11:54:29 +01:00
Önder Kalacı 508b392304
Merge pull request #3454 from citusdata/recursively_check_params
Make sure to recursively go into the functions to search for PARAMs
2020-02-03 11:27:12 +01:00
Onder Kalaci 2f274a4fce Make sure to go deeper into the functions to search for PARAMs
For example, a PARAM might reside inside a function just because
of a casting of a type such as the follows:

```
               {FUNCEXPR
               :funcid 1740
               :funcresulttype 1700
               :funcretset false
               :funcvariadic false
               :funcformat 2
               :funccollid 0
               :inputcollid 0
               :args (
                  {PARAM
                  :paramkind 0
                  :paramid 15
                  :paramtype 23
                  :paramtypmod -1
                  :paramcollid 0
                  :location 356
                  }
               )
```

We should recursively check the expression before bailing out.
2020-02-03 09:36:12 +01:00
Hadi Moshayedi 1adc293286
Merge pull request #3450 from citusdata/fix-ci-locale-issues
diff-filter: use utf8 encoding, not ascii
2020-01-30 21:57:18 -08:00
Philip Dubé db2eac5658 diff-filter: use utf8 encoding, not ascii 2020-01-31 00:03:17 +00:00
Hadi Moshayedi b0f9f94a52
Merge pull request #3448 from citusdata/insert_select_leak
Add insert/select connection leak tests
2020-01-30 14:20:14 -08:00
Hadi Moshayedi 9d988b3437 Add insert/select connection leak tests 2020-01-30 14:09:07 -08:00
Philip Dubé 461facb149
Merge pull request #3447 from citusdata/fix-group-by-distribution-no-group-by
Intermediate row pull up should be false whenever we can fully push down grouping
2020-01-30 21:31:34 +00:00
Philip Dubé d43c80d4d8 pullUpIntermediateRows should not be true when groupedByDisjointPartitionColumn is true
This was causing 'SELECT id, stdev(y_int) FROM tbl GROUP BY id' to push down stddev without group by
2020-01-30 21:18:08 +00:00
Philip Dubé d7204c9696
Merge pull request #3423 from citusdata/remove-directory-even-if-new-files-added
CitusRemoveDirectory: loop when directory is not empty
2020-01-30 20:21:47 +00:00
Philip Dubé 84a500ffc6 CitusRemoveDirectory: loop when directory is not empty
Sometimes during errors workers will create files while we're deleting intermediate directories

example:
DEBUG:  could not remove file "base/pgsql_job_cache/10_0_431": Directory not empty
DETAIL:  WARNING from localhost:57637
2020-01-30 20:02:08 +00:00
Philip Dubé 6b43fab325
Merge pull request #3406 from citusdata/fix-limit-approx
Expand the set of aggregates which cannot have LIMIT approximated
2020-01-30 18:00:40 +00:00
Philip Dubé 5fccc56d3e Expand the set of aggregates which cannot have LIMIT approximated
Previously we only prevented AVG from being pushed down, but this is incorrect:
- array_agg, while somewhat non sensical to order by, will potentially be missing values
- combinefunc aggregation will raise errors about cstrings not being comparable (while we also can't know if the aggregate is commutative)

This commit limits approximating LIMIT pushdown when ordering by aggregates to:
min, max, sum, count, bit_and, bit_or, every, any
Which means of those we previously supported, we now exclude:
avg, array_agg, jsonb_agg, jsonb_object_agg, json_agg, json_object_agg, hll_add, hll_union, topn_add, topn_union
2020-01-30 17:45:18 +00:00
Önder Kalacı 8584cb005b
Do not evaluate functions on the coordinator for SELECT queries (#3440)
Previously, the logic for evaluting the functions and the parameters
were the same. That ended-up evaluting the functions inaccurately
on the coordinator. Instead, split the function evaluation logic
from parameter evalution logic.
2020-01-30 08:47:28 +01:00
Önder Kalacı e9c17b71a4
Add missing ORDER BY (#3441)
As it causes some random failures
2020-01-29 17:36:32 +01:00
Önder Kalacı 412fe719f7
Hide citus.enable_ddl_propagation setting (#3437)
As that is powerful and cause metadata inconsistency. See the following steps:

(Note that we cannot use PGC_SUSET because on Citus MX we need this flag for non-
superusers as well)

```SQL
CREATE TABLE test_ref_table(key int);
SELECT create_reference_table('test_ref_table');

SELECT logicalrelid, logicalrelid::oid FROM pg_dist_partition;
┌────────────────┬──────────────┐
│  logicalrelid  │ logicalrelid │
├────────────────┼──────────────┤
│ test_ref_table │        16831 │
└────────────────┴──────────────┘
(1 row)

Time: 0.929 ms

SELECT relname FROM pg_class WHERE oid = 16831;
┌────────────────┐
│    relname     │
├────────────────┤
│ test_ref_table │
└────────────────┘
(1 row)

Time: 0.785 ms

SET citus.enable_ddl_propagation TO off;

 DROP TABLE test_ref_table ;

SELECT logicalrelid, logicalrelid::oid FROM pg_dist_partition;
┌──────────────┬──────────────┐
│ logicalrelid │ logicalrelid │
├──────────────┼──────────────┤
│ 16831        │        16831 │
└──────────────┴──────────────┘
(1 row)
Time: 0.972 ms

SELECT relname FROM pg_class WHERE oid = 16831;
┌─────────┐
│ relname │
├─────────┤
└─────────┘
(0 rows)

Time: 0.908 ms

 SELECT master_add_node('localhost', 9703);
server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
Time: 5.028 ms
!>

```
2020-01-29 10:17:53 +01:00
Philip Dubé 1ca108feda
Merge pull request #3429 from citusdata/diff-filter-handle-normalize
Update diff-filter to handle lines removed by normalization
2020-01-28 16:23:32 +00:00
Philip Dubé 40ce531850 Update diff-filter to handle lines removed by normalization
Add a script to test our diff logic

pg_regress_multi updated to rely on $PATH having copy_modified to fix testing with VPATH
2020-01-28 15:39:40 +00:00
Jelte Fennema b9eee70fa5 Fix random output ordering in CTE inlining test (#3434) 2020-01-27 16:38:27 +01:00
SaitTalhaNisanci 94bd563ff0
switch back to old memory context in cache local plan for task (#3428) 2020-01-27 13:00:46 +03:00