Commit Graph

4338 Commits (cceaf31e4c09c86485f12273a8b7036b12ec34cc)

Author SHA1 Message Date
SaitTalhaNisanci 25de5b1290
Fix uninitilized variable (#4293)
Valgrind found that, we were doing an if check on uninitialized variable
and it seems that this is on context.appendparents.

ac22929a26/src/backend/utils/adt/ruleutils.c (L1054)
2020-11-04 12:08:15 +03:00
Hanefi Onaldi 96913f6530
Merge pull request #4286 from citusdata/prevent-undistribute-partitions 2020-11-04 10:35:08 +03:00
jeff-davis 4339e91193 Merge pull request #31 from citusdata/upgrade
Handle case of partially-present metadata.
2020-11-03 12:15:51 -08:00
Jeff Davis 630e579912 Handle case of partially-present metadata. 2020-11-03 10:39:39 -08:00
Hanefi Önaldı d6f19e2298
Honor error message conventions 2020-11-03 18:11:18 +03:00
Hanefi Önaldı 85a4b61a0e
Prevent undistribute_table calls for partitions 2020-11-03 18:10:20 +03:00
Hanefi Onaldi feca381500
Merge pull request #4279 from citusdata/prevent-undistribute-foreign-tables
Prevent undistribute_table calls for foreign tables
2020-11-03 18:08:05 +03:00
Hanefi Önaldı 5db380f33a
Prevent undistribute_table calls for foreign tables 2020-11-03 17:33:29 +03:00
Nils Dijk d03e9ca861 Feature: cstore table options (#25)
DESCRIPTION: Add UDF's to maintain cstore table options

This PR adds two UDF's and a view to interact and maintain the cstore table options.

 - ``alter_cstore_table_set(relid REGCLASS, [ options ... ])``
 - ``alter_cstore_table_reset(relid REGCLASS, [ options ... ])``
 - ``cstore.cstore_options``

The `set` function takes options and their specific types. When specified it will change the option associated with the table to the provided value. When omitted no action is taken.

The `reset` function takes options as booleans. When set to `true` the value of the option associated with the table will be reset to the current default as specified by the associated GUC's.

The options view containes a record for every cstore table with its associated settings as columns.
2020-11-03 13:39:46 +01:00
jeff-davis 8909769975 Merge pull request #29 from citusdata/w-error
Use -Werror
2020-11-02 08:00:07 -08:00
Jeff Davis 653dbc615a Use -Werror 2020-11-02 07:55:19 -08:00
jeff-davis d455ef6785 Merge pull request #30 from citusdata/v13
Support for v13
2020-11-02 07:52:32 -08:00
Nils Dijk 288025d9ea add pg13 on CI 2020-11-02 13:04:18 +01:00
Sait Talha Nisanci 7c11aa124b Add component governance config
This config is used to generate components on ADO(Azure devops).
Currently this might not be super useful because we don't really use ADO
but when run, we can see the warnings/issues with components that we
use. A component is like a dependency basically.
2020-11-02 11:11:24 +03:00
Jeff Davis acd49b68aa Support for v13 2020-11-01 16:59:10 -08:00
Hadi Moshayedi 65cf9f0a6c Merge pull request #27 from citusdata/fix-clean
fix "make clean"
2020-10-30 21:08:26 -07:00
Jeff Davis a3caa5ff0f fix "make clean" 2020-10-30 19:27:42 -07:00
Hadi Moshayedi efb7cf9bda Merge pull request #22 from citusdata/concurrent_writes
Implement concurrent writes
2020-10-30 15:22:59 -07:00
Hadi Moshayedi c92ea1de96 Implement concurrent writes 2020-10-30 15:21:13 -07:00
Halil Ozan Akgül 5fcddfa2c6
Merge pull request #4254 from citusdata/outer-join-geqo-bug
Fixes geqo outer join bug
2020-10-22 14:16:27 +03:00
Halil Ozan Akgul 77b3be8b6d Turn RelOptInfos to only used field of them, relids, to be able to copy 2020-10-22 13:42:28 +03:00
Onur Tirtir ef49b75cd6
Fix memory issues around deparsing index commands (#4270) 2020-10-22 13:17:13 +03:00
Onur Tirtir f3d3381220
Merge pull request #4267 from citusdata/update-cl-942
Update CHANGELOG for 9.4.2
2020-10-21 16:03:18 +03:00
Onur Tirtir c7755103f1 Update CHANGELOG for 9.4.2 2020-10-21 15:05:17 +03:00
Önder Kalacı 808f30c1a2
Merge pull request #4264 from citusdata/remove_remove_duplicate
Remove RemoveDuplicateJoinRestrictions() function
2020-10-21 11:34:15 +02:00
Onder Kalaci 5c4c9304ba Remove RemoveDuplicateJoinRestrictions() function
RemoveDuplicateJoinRestrictions() function was introduced with the aim of decrasing the overall planning times by eliminating the duplicate JOIN restriction entries (#1989). However, it turns out that the function itself is so CPU intensive with a very high algorithmic complexity, it hurts a lot more than it helps. The function is a clear example of premature optimization.

The table below shows the difference clearly:

"distributed query planning
 time master"	RemoveDuplicateJoinRestrictions() execution time on master	"Remove the function RemoveDuplicateJoinRestrictions()
this PR"
5 table INNER JOIN	9 msec	2msec	7 msec
10 table INNER JOIN	227 msec	194 msec	29  msec
20 table INNER JOIN	1 sec 235 msec	1  sec 139  msec	90 msecs
50 table INNER JOIN	24 seconds	21 seconds	1.5 seconds
100 table INNER JOIN	2 minutes 16 secods	1 minute 53 seconds	23 seconds
250 table INNER JOIN	Bottleneck on JoinClauseList	18 minutes 52 seconds	Bottleneck on JoinClauseList

5 table INNER JOIN in subquery	9 msec	0 msec	6 msec
10 table INNER JOIN subquery	33 msec	10 msec	32 msec
20 table INNER JOIN subquery	132 msec	67 msec	123 msec
50 table INNER JOIN subquery	1.2  seconds	900 msec	500 msec
100 table INNER JOIN subquery	6 seconds	5  seconds	2 seconds
250 table INNER JOIN subquery	54 seconds	37 seconds	20  seconds

5 table LEFT JOIN	5 msec	0 msec	5 msec
10 table LEFT JOIN	11 msec	0 msec	13 msec
20 table LEFT JOIN	26 msec	2 msec	30 msec
50 table LEFT JOIN	150 msec	15 msec	193 msec
100 table LEFT JOIN	757 msec	71 msec	722 msec
250 table LEFT JOIN	8 seconds	600 msec	8 seconds

5 JOINs among 2 table JOINs 	37 msec	11 msec	25 msec
10 JOINs among 2 table JOINs 	536 msec	306 msec	352 msec
20 JOINs among 2 table JOINs 	794 msec	181 msec	640 msec
50 JOINs among 2 table JOINs 	25 seconds	2 seconds	22 seconds
100 JOINs among 2 table JOINs 	Bottleneck on JoinClauseList	9 seconds	Bottleneck on JoinClauseList
150 JOINs among 2 table JOINs 	Bottleneck on JoinClauseList	46 seconds	Bottleneck on JoinClauseList

On top of the performance penalty, the function had a critical bug #4255, and with #4254 we hit one more important bug. It should be fixed by adding the followig check to the ContextCoversJoinRestriction():
```
static bool
JoinRelIdsSame(JoinRestriction *leftRestriction, JoinRestriction *rightRestriction)
{
	Relids leftInnerRelIds = leftRestriction->innerrel->relids;
	Relids rightInnerRelIds = rightRestriction->innerrel->relids;
	if (!bms_equal(leftInnerRelIds, rightInnerRelIds))
	{
		return false;
	}

	Relids leftOuterRelIds = leftRestriction->outerrel->relids;
	Relids rightOuterRelIds = rightRestriction->outerrel->relids;
	if (!bms_equal(leftOuterRelIds, rightOuterRelIds))
	{
		return false;
	}

	return true;
}
```

However, adding this eliminates all the benefits tha RemoveDuplicateJoinRestrictions() brings.

I've used the commands here to generate the JOINs mentioned in the PR: https://gist.github.com/onderkalaci/fe8654f9df5916c7af4c7c5eb892561e#file-gistfile1-txt

Inner and outer JOINs behave roughly the same, to simplify the table only added INNER joins.
2020-10-21 10:29:39 +02:00
Onur Tirtir 790beea59f
Add intermediate result tests with unsupported outer joins (#4262) 2020-10-20 12:11:18 +03:00
Hadi Moshayedi 4303758a28 Merge pull request #23 from citusdata/triggers
trigger fix and tests
2020-10-19 10:21:14 -07:00
SaitTalhaNisanci 0f209377c4
Fix incorrect join related fields (#4242)
* Fix incorrect join related fields

Ruleutils expect to give the original index of join columns hence we
should consider the dropped columns while setting the fields in
SetJoinRelatedFieldsCompat.

* add some more tests for joins

* Move tests to join.sql and create a utility function
2020-10-19 18:28:39 +03:00
Onur Tirtir c49077d594
Disallow outer joins `ON TRUE` with ref & dist tables when ref table is outer relation (#4255)
Disallow `ON TRUE` outer joins with reference & distributed tables
when reference table is outer relation by fixing the logic bug made
when calling `LeftListIsSubset` function.

Also, be more defensive when removing duplicate join restrictions
when join clause is empty for non-inner joins as they might still
contain useful information for non-inner joins.
2020-10-19 16:58:11 +03:00
Onur Tirtir 6e493624af
Merge pull request #4103 from citusdata/remove-unused-functions
Remove unused functions that cppcheck found
2020-10-19 14:58:29 +03:00
Onur Tirtir f80f4839ad Remove unused functions that cppcheck found 2020-10-19 13:50:52 +03:00
Önder Kalacı 25e43a4aa6
Merge pull request #4253 from citusdata/improve_perf_for_queries
Improve the relation restriction counters
2020-10-19 09:22:03 +02:00
Onder Kalaci bbedfca761 Improve the relation restriction counters
It seems like Postgres could call set_rel_pathlist() for
the same relation multiple times. This breaks the logic
where we assume relationCount eqauls to the number of
entries in relationRestrictionList.

In summary, relationRestrictionList may contain duplicate
entries.
2020-10-19 08:51:16 +02:00
Hadi Moshayedi 4708dc04f1
Merge pull request #4257 from citusdata/tableam_hadi
Set explicit transfer_mode in tableam tests
2020-10-16 12:54:52 -07:00
Hadi Moshayedi 663549db33 Set explicit transfer_mode in tableam tests 2020-10-16 12:40:37 -07:00
Hadi Moshayedi db96b9f861
Merge pull request #4250 from citusdata/tableam_hadi
Support "CREATE TABLE ... USING table_access_method" for distributed tables
2020-10-16 12:18:37 -07:00
Nils Dijk caabbf4b84 Table access method support for distributed tables 2020-10-16 12:02:25 -07:00
Onur Tirtir 7cb07c70fa
Move hasSemiJoin to JoinRestrictionContext (#4256) 2020-10-16 18:37:39 +03:00
Marco Slot 3261fc7eef
Merge pull request #4251 from citusdata/fix/ref-view-mod
Support view in reference table modification
2020-10-16 11:37:41 +02:00
Marco Slot 8976f245ab Support reference table view in reference table modification 2020-10-16 11:31:24 +02:00
Onur Tirtir de6f2d3f42
Refactor JoinRestrictionListExistsInContext to improve readability (#4249) 2020-10-16 12:24:56 +03:00
Önder Kalacı 212adfb26f
Merge pull request #4245 from citusdata/add_single_node_tests_more
Add more regression test for single node Citus
2020-10-15 17:49:03 +02:00
Onder Kalaci 596f7bf4a9 Add more regression test for single node Citus
Tests on commands with SCHEMA.
2020-10-15 17:32:32 +02:00
Önder Kalacı 3e5a92d33b
Merge pull request #4236 from citusdata/fix_intermediate_size
Local execution enforces citus.max_intermediate_result_size
2020-10-15 17:26:51 +02:00
Onder Kalaci fe3caf3bc8 Local execution considers intermediate result size limit
With this commit, we make sure that local execution adds the
intermediate result size as the distributed execution adds. Plus,
it enforces the citus.max_intermediate_result_size value.
2020-10-15 17:18:55 +02:00
Marco Slot ded4561661
Merge pull request #4246 from citusdata/fix/table-exists
Check table existence in EnsureRelationKindSupported
2020-10-15 17:18:05 +02:00
Jeff Davis 4355ca4945 trigger fix and tests 2020-10-15 08:05:35 -07:00
Marco Slot 31858c8a29 Check table existence in EnsureRelationKindSupported 2020-10-15 17:05:06 +02:00
SaitTalhaNisanci b5a3526c07
Merge pull request #4233 from citusdata/introduce_get_local_execution_status
Introduce GetCurrentLocalExecutionStatus wrapper
2020-10-15 15:55:46 +03:00