danolivo / pgdev Goto Github PK
View Code? Open in Web Editor NEWThis project forked from postgres/postgres
My experiments with mirror of the official PostgreSQL GIT repository.
Home Page: http://www.postgresql.org/
License: Other
This project forked from postgres/postgres
My experiments with mirror of the official PostgreSQL GIT repository.
Home Page: http://www.postgresql.org/
License: Other
I mean here, we should delete the restriction before changing and propagate by distribute_restrictinfo_to_rels() as designed in remove_rel_from_query
We use physical time to create timestamp. But we correct it with some type of logical time (not wait for timeout) in the case of any problems. Analyze and test this aspect of our implementation.
We need 3 nodes with unstable clock. We must switch the time during the test randomly.
We do it to solve a narrow problem. Analyze: why we haven't another way.
ERROR: plan should not reference subplan's variable
Replay:
EXPLAIN (COSTS OFF)
SELECT * FROM subselect_tbl a
WHERE a.f1 IN (
WITH cte AS (
SELECT * FROM subselect_tbl c WHERE f1 < 42 AND f2 = a.f1
)
SELECT b.f2 FROM cte b WHERE b.f2 = a.f2 AND b.f2 < 12
)
;
querytree->hasAggs ||
querytree->hasWindowFuncs ||
querytree->hasTargetSRFs ||
querytree->hasSubLinks ||
querytree->cteList ||
querytree->rtable ||
querytree->jointree->fromlist ||
querytree->jointree->quals ||
querytree->groupClause ||
querytree->groupingSets ||
querytree->havingQual ||
querytree->windowClause ||
querytree->distinctClause ||
querytree->sortClause ||
querytree->limitOffset ||
querytree->limitCount ||
querytree->setOperations ||
In many tests on AWS we cought the error "Snapshot too old". In all tests difference in time was 5 seconds. It may be a bug. But it may be an internal problem of AWS clocks.
Techniqiues:
2. INNER JOIN Elimination
3. OUTER JOIN Elimination
4. OUTER JOIN Elimination with DISTINCT
Which of these techniques implemented (or can be possible implemented with our approach)?
Advantages:
Disadvantages
See:
explain (COSTS OFF)
SELECT * FROM pg_am am WHERE am.amname IN (
SELECT c1.relname AS relname
FROM pg_class c1
JOIN pg_class c2
ON c1.oid=c2.oid AND c1.oid < 10
JOIN pg_class c3 ON (c3.oid = c2.oid)
);
Result is OK:
Hash Semi Join
Hash Cond: (am.amname = c3.relname)
-> Seq Scan on pg_am am
-> Hash
-> Index Scan using pg_class_oid_index on pg_class c3
Index Cond: ((oid < '10'::oid) AND (oid IS NOT NULL))
Query N0.2:
explain (COSTS OFF)
SELECT * FROM pg_am am WHERE am.amname IN (
SELECT c1.relname AS relname
FROM pg_class c1
JOIN pg_class c2
ON c1.oid=c2.oid AND c1.oid < 10
JOIN pg_class c3 ON (c1.oid = 1 AND c3.oid = 1)
);
No one JOIN was deleted:
Nested Loop Semi Join
Join Filter: (am.amname = c1.relname)
-> Seq Scan on pg_am am
-> Materialize
-> Nested Loop
-> Nested Loop
-> Index Scan using pg_class_oid_index on pg_class c1
Index Cond: ((oid < '10'::oid) AND (oid = '1'::oid))
-> Index Only Scan using pg_class_oid_index on pg_class c2
Index Cond: (oid = '1'::oid)
-> Index Only Scan using pg_class_oid_index on pg_class c3
Index Cond: (oid = '1'::oid)
Query N0.3:
SELECT * FROM pg_am am WHERE am.amname IN (
SELECT c1.relname AS relname
FROM pg_class c1
JOIN pg_class c2
ON c1.oid=c2.oid AND c1.oid < 10
JOIN pg_class c3 ON (c3.oid = 1 AND c1.oid = 1)
);
Only one JOIN was deleted:
Nested Loop Semi Join
Join Filter: (am.amname = c2.relname)
-> Seq Scan on pg_am am
-> Materialize
-> Nested Loop
-> Index Scan using pg_class_oid_index on pg_class c2
Index Cond: ((oid < '10'::oid) AND (oid IS NOT NULL))
-> Index Only Scan using pg_class_oid_index on pg_class c3
Index Cond: (oid = '1'::oid)
Currently, the rule "xact confirmed as committed, so any following xact must see its effects" might be violated.
Example:
Time(node1) >> Time(node2)
user executes transaction No.1 at node1 with time=10, update data at node1 and node2 and commit.
The same user start transaction No.2 at node2 with time=5 and can't see changes of committed (user done this sometimes ago) transaction.
Maybe it is not a problem of distributed DBMS? Maybe we should consider this as a feature of distributed transactions?
That I mean we could allow (an example):
EXPLAIN (COSTS OFF)
SELECT * FROM subselect_tbl a
WHERE a.f1 IN (SELECT b.f2*b.f1/b.f3+2 FROM subselect_tbl b WHERE b.f3 = a.f2)
;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.