Commit Graph

934 Commits (c3a651059aaad6c9e2ed7f81338134eb05a9f363)

Author SHA1 Message Date
Murat Tuncer c3a651059a Enable top level subquery join queries
This work enables
- Top level subquery joins
- Joins between subqueries and relations
- Joins involving more than 2 range table entries

A new regression test file is added to reflect enabled test cases
2017-04-11 14:46:33 +03:00
Önder Kalacı 723e9a1a7f Merge pull request #1297 from citusdata/subquery_use_original_query
Subquery pushdown planner uses original query
2017-04-11 14:25:11 +03:00
Onder Kalaci 5ed42c21ba Subquery pushdown planner uses original query
With this commit, we change the input to the logical planner for
subquery pushdown. Before this commit, the planner was relying
on the query tree that is transformed by the postgresql planner.
After this commit, the planner uses the original query. The main
motivation behind this change is the simplify deparsing of
subqueries.
2017-04-11 14:22:16 +03:00
Önder Kalacı 3c41f9abff Merge pull request #1282 from citusdata/subquery_physical_planner
Physical planner changes for subquery pushdown
2017-04-11 14:11:12 +03:00
Onder Kalaci c0d359484b Enabling physical planner for subquery pushdown changes
This commit applies the logic that exists in INSERT .. SELECT
planning to the subquery pushdown changes.

The main algorithm is followed as :
   - pick an anchor relation (i.e., target relation)
   - per each target shard interval
       - add the target shard interval's shard range
         as a restriction to the relations (if all relations
         joined on the partition keys)
        - Check whether the query is router plannable per
          target shard interval.
        - If router plannable, create a task
2017-04-11 13:56:04 +03:00
Onder Kalaci aa15a5bb8c Change time values per row 2017-04-11 11:26:28 +03:00
Onder Kalaci e635de95a0 Rename functions and files 2017-04-11 11:11:24 +03:00
Onder Kalaci 47fc6a7afe Minor style commit 2017-04-11 11:11:23 +03:00
Onder Kalaci 364749e282 Apply more feedback by @mtuncer 2017-04-11 11:11:23 +03:00
Onder Kalaci 4617d40343 rename file -- add missing file 2017-04-11 11:11:23 +03:00
Onder Kalaci 2fa81b0276 rename file 2017-04-11 11:11:23 +03:00
Onder Kalaci dc667a3db1 Skip adding equal attribute classes into a list 2017-04-11 11:11:23 +03:00
Onder Kalaci 0644e72539 undo enabling set operations for INSERT .. SELECT 2017-04-11 11:11:23 +03:00
Onder Kalaci 4c41096370 Apply @mtuncer's reviews 2017-04-11 11:11:23 +03:00
Onder Kalaci 427af34719 Apply @anarazel's feedback
- Add a new file for colocated subqueries
- Add only partition keys to the attribute equivalence
- Minor style changes along with minor structural changes
2017-04-11 11:11:22 +03:00
Onder Kalaci 3825d4fd77 Remove uninstantiated qual logic, use attribute equivalences
In this PR, we aim to deduce whether each of the RTE_RELATION
is joined with at least on another RTE_RELATION on their partition keys. If each
RTE_RELATION follows the above rule, we can conclude that all RTE_RELATIONs are
joined on their partition keys.

In order to do that, we invented a new equivalence class namely:
AttributeEquivalenceClass. In very simple words, a AttributeEquivalenceClass is
identified by an unique id and consists of a list of AttributeEquivalenceMembers.

Each AttributeEquivalenceMember is designed to identify attributes uniquely within the
whole query. The necessity of this arise since varno attributes are defined within
a single level of a query. Instead, here we want to identify each RTE_RELATION uniquely
and try to find equality among each RTE_RELATION's partition key.

Whenever we find an equality clause A = B, where both A and B originates from
relation attributes (i.e., not random expressions), we create an
AttributeEquivalenceClass to record this knowledge. If we later find another
equivalence B = C, we create another AttributeEquivalenceClass. Finally, we can
apply transitity rules and generate a new AttributeEquivalenceClass which includes
A, B and C.

Note that equality among the members are identified by the varattno and rteIdentity.

Each equality among RTE_RELATION is saved using an AttributeEquivalenceClass where
each member attribute is identified by a AttributeEquivalenceMember. In the final
step, we try generate a common attribute equivalence class that holds as much as
AttributeEquivalenceMembers whose attributes are a partition keys.
2017-04-11 11:11:22 +03:00
Burak Velioglu cfc0992137 Merge pull request #1300 from citusdata/ltree_copy_branch
Change copy format of ltree
2017-04-11 08:41:44 +03:00
velioglu 1fb11c738f Check binary output function of type. 2017-04-10 16:28:09 +03:00
Jason Petersen 8c5d0f686b Merge pull request #1277 from citusdata/error_out_incomplete_installation
Error out if binary citus version does not match installed extension

cr: @jasonmp85
2017-04-04 16:49:03 -06:00
Jason Petersen 8b4620ef16
Use RESET for GUC test, not reconnect
More limited in what it does, better test.
2017-04-04 16:40:17 -06:00
Jason Petersen 7e46f41c12
Add comments, use strncmp, clean up GUC desc.
Good to go!
2017-04-04 16:16:49 -06:00
Jason Petersen 033fda9183
Clean up remaining error messages
Added details and hints, based off of similar PostgreSQL scenarios.
2017-04-04 16:11:59 -06:00
Jason Petersen ef81b21a49
Clean up ErrorIfUnstableCreateOrAlterExtensionStmt
Swaps an Assert in for an ereport, and adds details and hints to the
error message to help users with a possibly confusing scenario.
2017-04-04 15:58:57 -06:00
Jason Petersen ad3fbd9689
Refactor utility-skip/extn-check code
This was getting pretty long and complex in the context of the main
utility hook. Moved out the checks for what should skip Citus process-
ing and what should have version checks performed.
2017-04-04 15:07:22 -06:00
Burak Yucesoy a09614553f Add enable_version_checks GUC and address feedback 2017-04-04 19:11:13 +03:00
Jason Petersen 1c2056ec74
Self-implemented review feedback
The use of a bare src/ rather than $srcdir caused configure to fail
during VPATH builds. With our additional dependency upon AWK, we need
to call AC_PROG_AWK, otherwise environments may not have $AWK set.
Finally, citus_version.h should be in .gitignore.
2017-04-03 22:55:12 -06:00
Burak Yucesoy 087d8427e3
Error out if binary citus version does not match installed extension
With this change, we start to error out if loaded citus binaries does not match
the available major version or installed citus extension version. In this case
we force user to restart the server or run ALTER EXTENSION depending on the
situation
2017-04-03 17:36:13 -06:00
Jason Petersen bb5ae5eca4 Merge pull request #1287 from citusdata/support_concurrently
Support (CREATE|DROP) INDEX CONCURRENTLY

cr: @metdos
2017-04-03 12:06:11 -06:00
Jason Petersen 4cdfc3a10f
Address review feedback
Should just about do it.
2017-04-03 11:44:57 -06:00
Jason Petersen cf775c4773
Improve CONCURRENTLY-related error messages
Thought this looked slightly nicer than the default behavior.

Changed preventTransaction to concurrent to be clearer that this code
path presently affects CONCURRENTLY code only.
2017-04-03 11:19:15 -06:00
Jason Petersen dd9365433e
Update documentation
Ensure all functions have comments, etc.
2017-04-03 11:19:15 -06:00
Jason Petersen d904e96c59
Address MX CONCURRENTLY problems
Adds a non-transactional multi-command method to propagate DDLs to all
MX/metadata-synced nodes.
2017-04-03 11:19:15 -06:00
Jason Petersen 32886e97a3
Add code to set index validity on failure
Coordinator code marks index as invalid as a base, set it as valid in a
transactional layer atop that base, then proceeds with worker commands.
If a worker command has problems, the rollback results in an index with
isvalid = false. If everything succeeds, the user sees a valid index.
2017-04-03 11:19:15 -06:00
Jason Petersen dea6c44f75
Remove CONCURRENTLY checks, fix tests
Still pending failure testing, which broke with my recent changes.
2017-04-03 11:19:15 -06:00
Jason Petersen 0b6c4e756e
Change DropStmt to generate worker DDL on master
Because we can't execute DROP INDEX CONCURRENTLY during transactions,
worker_apply_shard_ddl_command is insufficient.
2017-04-03 11:19:15 -06:00
Jason Petersen 95d8d27c4f
Change IndexStmt to generate worker DDL on master
Because we can't execute CREATE INDEX CONCURRENTLY during transactions,
worker_apply_shard_ddl_command is insufficient.
2017-04-03 11:19:14 -06:00
Marco Slot de034d2cab Merge pull request #851 from citusdata/task_tracker_batching
Batch task_tracker_status calls to reduce task-tracker query times
2017-04-03 12:17:13 +02:00
Marco Slot 0f355a4a48 Batch task_tracker_status calls to reduce task-tracker query times 2017-03-31 11:54:11 +02:00
Metin Döşlü e25df3509c Merge pull request #1299 from citusdata/support_trigger_all
Add disable/enable trigger all support
2017-03-30 18:36:14 +02:00
Metin Doslu 54a277ff01 Add disable/enable trigger all support 2017-03-29 22:00:14 +03:00
Önder Kalacı 95e43eb256 Merge pull request #1261 from citusdata/fix_wrong_pushdown_properly
Fix pushing down wrong queries for INSERT ... SELECT queries
2017-03-24 12:52:31 +02:00
Onder Kalaci 11665dbe3c Fix pushing down wrong queries for INSERT ... SELECT queries
Before this commit, in certain cases router planner allowed pushing
down JOINs that are not on the partition keys.

With @anarazel's suggestion, we change the logic to use uninstantiated
parameter. Previously, the planner was traversing on the restriction
information and once it finds the parameter, it was replacing it with
the shard range. With this commit, instead of traversing the restrict
infos, the planner explicitly checks for the equivalence of the relation
partition key with the uninstantiated parameter. If finds an equivalence,
it adds the restrictions. In this way, we have more control over the
queries that are pushed down.
2017-03-24 11:37:35 +02:00
Ozgun Erdogan 6fbd8e27c3 Merge pull request #1295 from citusdata/ozgune-readme-step-numbering
Minor update README.md to fix the numbers in Docker installation steps.
2017-03-23 14:52:26 -07:00
Ozgun Erdogan 1285cabf28 Update README.md
Updated the Local Cluster steps to include the right numbering.
2017-03-23 11:00:32 -07:00
Jason Petersen dc8c12f8b0 Merge pull request #1278 from citusdata/master_ddl_first
Execute DDL on coordinator before workers

cr: @metdos, @anarazel
2017-03-22 17:45:06 -06:00
Jason Petersen 34a62abb7d
Address code review comments 2017-03-22 17:29:17 -06:00
Jason Petersen d95b5bbad3
Rework ReplicateGrantStmt to use new flow
This was the impetus for the previous commit that changed from using a
DDLJob * to a List * of them.
2017-03-22 17:29:16 -06:00
Jason Petersen 23f5e4282d
Change DDLJob usage to be wrapped in lists
To prepare for GRANT fixes.
2017-03-22 17:29:16 -06:00
Jason Petersen 42c799faee
Fix MX tests
Missed some of these. One had a bad DDL statement to begin with (mixed
up column type and column name) and other was just master/worker order.
2017-03-22 17:21:49 -06:00
Jason Petersen f181b24859
Move worker execution to after master, fix tests
Some tests relied on worker errors though local commands were invalid.
Fixed those by ensuring preconditions were met to have command work
correctly. Otherwise most test changes are related to slight changes
in local/remote error ordering.
2017-03-22 17:21:49 -06:00