Commit Graph

2321 Commits (recursively_plan_outer_joins)

Author SHA1 Message Date
Onder Kalaci 7aa718b2f7 respect the regression tests for recursively plan inner parts of recurring tuple joins 2019-03-11 14:39:00 +03:00
Onder Kalaci 8e75753544 Recursively plan inner parts of recurring tuple joins
With this commit, we're enabling recursive planning for the
queries that used to fail due to recurring tuples.

We're simply returning the inner relations/subqueries to the caller
of the error check, which is then able to recursively plan them.
2019-03-11 13:38:11 +03:00
Onder Kalaci 68fe87c899 Pushdown only necessary projections in the recursive relation planning
With this commit, we only pull&push the necessary columns. In this
context, necessary columns means that the columns that are required
for the query to be executed when the relation is wrapped into a
subquery.

We could potentially optimize things further:

(a) If a column only appears as a qual filter, we don't need to
    pull it to the coordinator
(b) We currently pull unnecessary columns as NULL. However, we
    could potentially adjust remaining of the query tree and do
    not add columns of the relation to the target entry.
2019-03-11 13:23:52 +03:00
Onder Kalaci 5078cd51e5 Add tests for filter pushdown 2019-03-11 13:23:44 +03:00
Onder Kalaci a6a1641f7f Pushdown filters on recursive relation planning
PostgreSQL already keeps track of the restrictions that are on the relation.
With this commit, Citus uses that information and pushes down the filters
to the subquery that is recursively planned for the table that is in
considiration.
2019-03-11 13:20:20 +03:00
Onder Kalaci 75771e23db Basic implementation of recursive planning of non-colocated relation joins 2019-03-11 13:19:31 +03:00
Murat Tuncer e813df4d7f
Merge pull request #2601 from citusdata/fix_column_alias
Add support for column aliases on join clauses
2019-03-07 13:39:11 +03:00
Murat Tuncer 2681231c98 Create column aliases for shard tables in worker queries when requested 2019-03-07 12:54:42 +03:00
Hadi Moshayedi f4d3b94e22
Fix some of the casts for groupId (#2609)
A small change which partially addresses #2608.
2019-03-05 12:06:44 -08:00
Burak Velioglu 900ffa76f5
Merge pull request #2597 from citusdata/full_outer_pushdown
Fix full outer join with subquery pushdown
2019-03-05 17:08:08 +03:00
velioglu faf50849d7 Enhance pushdown planning logic to handle full outer joins with using clause
Since flattening query may flatten outer joins' columns into coalesce expr that is
in the USING part, and that was not expected before this commit, these queries were
erroring out. It is fixed by this commit with considering coalesce expression as well.
2019-03-05 11:49:30 +03:00
Önder Kalacı 6594ffafa1
Merge pull request #2618 from citusdata/fix_relation_size_leak
Make sure to clear `PGresult` in missing places
2019-03-01 14:44:43 +01:00
Onder Kalaci 26f569abd8 Make sure to clear PGresult on few places
This leads to a memory leak otherwise.
2019-02-28 13:44:34 +03:00
Jason Petersen bf9a119b6f
Merge pull request #2616 from citusdata/circleci
Enable CircleCI
2019-02-26 23:48:11 -07:00
Jason Petersen dceaae3b95
Remove codecov push from Travis build 2019-02-26 23:01:40 -07:00
Jason Petersen 6c3f7b665f
Squelch indentation errors (uncrustify is old in Travis) 2019-02-26 23:01:40 -07:00
Jason Petersen 3df2f51881
Turn on style-checking, fix lingering violations
We'd been ignoring updating uncrustify for some time now because I'd
thought these were misclassifications that would require an update in
our rules to address. Turns out they're legit, so I'm checking them in.
2019-02-26 23:01:40 -07:00
Jason Petersen 383871af7e
Upload Codecov results after test runs
Our first orb use!
2019-02-26 23:01:40 -07:00
Jason Petersen 5817bc3cce
Add test-timing script
Through some clever stream redirections and options, we can get decent
timing data for each of our tests.
2019-02-26 23:01:40 -07:00
Jason Petersen 1b605a6109
Modernize coverage options
These hadn't been looked at in a while, and I'm somewhat certain they
actually were running with optimization on, which is pretty bad.

Swapped out the lower-level flags for `--coverage`, which will work
with both `clang` and `gcc`. On some platforms, linker flags are need-
ed as well.
2019-02-26 22:20:31 -07:00
Jason Petersen 5db45bac45
Enable CircleCI
The configuration for the build is in the YAML file; the changes to the
regression runner are backward-compatible with Travis and just add the
logic to detect whether our custom (isolation- and vanilla-enabled) pkg
is present.
2019-02-26 22:17:26 -07:00
Önder Kalacı 25b5fc9d14
Merge pull request #2610 from citusdata/improve_round_robin
Add transactionId based round robin policy
2019-02-25 13:12:24 +01:00
Onder Kalaci f706772b2f Round-robin task assignment policy relies on local transaction id
Before this commit, round-robin task assignment policy was relying
on the taskId. Thus, even inside a transaction, the tasks were
assigned to different nodes. This was especially problematic
while reading from reference tables within transaction blocks.
Because, we had to expand the distributed transaction to many
nodes that are not necessarily already in the distributed transaction.
2019-02-22 19:26:38 +03:00
Önder Kalacı acc2b0a387
Merge pull request #2606 from citusdata/fast_path_router_planner
Introduce fast path router planning
2019-02-22 17:17:17 +01:00
Onder Kalaci e521e7e39c Apply feedback 2019-02-22 18:14:30 +03:00
Onder Kalaci 407d0e30f5 Fix selectForUpdate bug 2019-02-21 18:21:41 +03:00
Onder Kalaci f144bb4911 Introduce fast path router planning
In this context, we define "Fast Path Planning for SELECT" as trivial
queries where Citus can skip relying on the standard_planner() and
handle all the planning.

For router planner, standard_planner() is mostly important to generate
the necessary restriction information. Later, the restriction information
generated by the standard_planner is used to decide whether all the shards
that a distributed query touches reside on a single worker node. However,
standard_planner() does a lot of extra things such as cost estimation and
execution path generations which are completely unnecessary in the context
of distributed planning.

There are certain types of queries where Citus could skip relying on
standard_planner() to generate the restriction information. For queries
in the following format, Citus does not need any information that the
standard_planner() generates:

  SELECT ... FROM single_table WHERE distribution_key = X;  or
  DELETE FROM single_table WHERE distribution_key = X; or
  UPDATE single_table SET value_1 = value_2 + 1 WHERE distribution_key = X;

Note that the queries might not be as simple as the above such that
GROUP BY, WINDOW FUNCIONS, ORDER BY or HAVING etc. are all acceptable. The
only rule is that the query is on a single distributed (or reference) table
and there is a "distribution_key = X;" in the WHERE clause. With that, we
could use to decide the shard that a distributed query touches reside on
a worker node.
2019-02-21 13:27:01 +03:00
Marco Slot fbc22aa6d3
Merge pull request #2521 from citusdata/citus-sql-auto-target
Simplify make file for citus sql files
2019-02-20 12:06:27 +01:00
Nils Dijk 1623c44fc7 Simplify make file for citus sql files 2019-02-19 21:29:20 -05:00
Hanefi Onaldi d6767ad521
Merge pull request #2572 from citusdata/execute-functions-on-coordinator
Wrap function calls in joins inside subqueries
2019-02-04 23:27:04 +03:00
Hanefi Onaldi 148dcad0bb
More documentation and stale comments rewritten 2019-02-04 20:21:51 +03:00
Hanefi Onaldi 825666f912
Query samples in docs and better errors 2019-02-04 19:20:02 +03:00
Hanefi Onaldi 574b071113
Add wrapper function introduced in PG11 for compatibility 2019-02-04 19:20:02 +03:00
Hanefi Onaldi 1106e14385
Wrap functions in subqueries
remove debug logs to fix travis tests

Support RowType functions in joins

Regression tests for a custom type function in join
2019-02-04 19:19:29 +03:00
Hanefi Onaldi 588e7e673d
Merge pull request #2535 from citusdata/failure_mx_metadata_sync
Failure/cancellation tests for mx metadata sync
2019-02-01 12:17:05 +03:00
Hanefi Onaldi 4dd1f5784b
Failure&cancellation tests for mx metadata sync
Failure&Cancellation tests for initial start_metadata_sync() calls
to worker and DDL queries that send metadata syncing messages to an MX node

Also adds message type definitions for messages that are exchanged
during metadata syncing
-
2019-02-01 11:50:25 +03:00
Murat Tuncer 967b369f10
Merge pull request #2590 from citusdata/relax_reference_union_pushdown
Relax reference table restrictions in subquery union pushdowns
2019-01-31 16:04:06 +03:00
Murat Tuncer b36b59dd4f Relax reference table restrictions in subquery union pushdowns
We used to error out if there is a reference table
in the query participating a union. This has caused
pushdownable queries to be evaluated in coordinator.

Now we let reference tables inside union queries as long
as there is a distributed table in from clause.

Existing join checks (reference table on the outer part)
sufficient enought that we do not need check the join relation
of reference tables.
2019-01-31 15:34:29 +03:00
Önder Kalacı 501eaebe77
Merge pull request #2598 from citusdata/fix_router_errors
Queries with only intermediate results do not rely on task assignment policy
2019-01-28 16:39:29 +01:00
Onder Kalaci ec67381ba2 Queries with only intermediate results do not rely on task assignment policy
Previously we allowed task assignment policy to have affect on router queries
with only intermediate results. However, that is erroneous since the code-path
that assigns placements relies on shardIds and placements, which doesn't exists
for intermediate results.

With this commit, we do not apply task assignment policies when a router query
hits only intermediate results.
2019-01-28 17:59:17 +03:00
Murat Tuncer 913cac2391
Merge pull request #2599 from citusdata/fix_fk_from_partition_to_reference
Fix partitioned table operations involving foreign key to reference table
2019-01-28 17:01:43 +03:00
Murat Tuncer cd5213abee Set sequential mode execution GUC for alter partitioned table
PG recently started propagating foreign key constraints
to partition tables. This came with a select query
to validate the the constaint.

We are already setting sequential mode execution for this
command. In order for validation select query to respect
this setting we need to explicitly set the GUC.

This commit also handles detach partition part.
2019-01-25 15:28:07 +03:00
Burak Velioglu 1f4f6ea041
Merge pull request #2585 from citusdata/plan_recursive_exception
Reset planner context instead of popping with recursive planning
2019-01-17 17:24:19 +03:00
velioglu 1bb0ec316a Reset planner restriction context instead of popping with recursive planning 2019-01-17 14:35:16 +03:00
Jason Petersen 339e6e661e
Remove 9.6 (#2554)
Removes support and code for PostgreSQL 9.6

cr: @velioglu
2019-01-16 13:11:24 -07:00
Nils Dijk 0de756559c
Merge pull request #2576 from citusdata/test/base-valgrind
Add make target to run regression tests in isolation with valgrind
2019-01-16 12:26:14 +01:00
Nils Dijk 3f2bac18df
Add make target to run regression tests in isolation with vagrant
Also allow `multi_alter_table_add_constraints` to run in isolation
2019-01-16 11:41:09 +01:00
Jason Petersen 183b2d6c06
Remove 9.6
To spare people the pain while I finish my PR feedback.
2019-01-14 23:46:19 -07:00
Hanefi Onaldi 21f72f5002
Add changelog entry for 8.0.3 (#2581) 2019-01-09 15:21:45 +03:00
Marco Slot d7ee6f2127
Merge pull request #2481 from citusdata/outer_join_pushdown
Plan outer joins through pushdown planning
2019-01-08 10:46:59 +01:00