-
Notifications
You must be signed in to change notification settings - Fork 55
Stable13 #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Stable13 #29
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
197145a
Prevent distributed deadlocks. Disable AQO for FDW queries.
danolivo 626d5ee
Allow learning (and predicting for) on a ForeignScan, an Append, a Me...
danolivo 386cd6d
Add support of postgres_fdw push-down.
danolivo 0cd3ce3
Process GatherMergePath in get_path_clauses routine.
danolivo e8dcb5b
Add a foreign relation estimation hook into the core patch and AQO.
danolivo 38d4f77
Add basic regression test on FDW support.
danolivo 8291220
Add missed aqo_fdw.sql
danolivo 9aff621
Prepare the insert_index routine for PGv14 signature
danolivo 36c97ac
Change the license sentence in accordance with 2021.
danolivo 34c640d
Fix the state:
danolivo fbf27d6
Rename aqo.details to aqo.show_details.
danolivo d8e18ce
Update the readme file in accordance with the new AQO version.
danolivo 418c7d4
Bugfix of the aqo_fdw regress test
danolivo 505c064
Update README.md
danolivo 453bef5
Rename the aqo_details to aqo_show_details
danolivo d705b5d
Store selectivity cache data in the cache memory context instead of
danolivo 2b20ff0
Change insert/update scheme for the ML-knowledge base.
danolivo 436b3e6
Improve AQO makefile
danolivo 8ec6572
Bugfix: don't create ignorance table in parallel worker.
danolivo d339ad0
Make the explain of AQO more readable.
danolivo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Change insert/update scheme for the ML-knowledge base.
Big commit. To avoiding UPDATE/UPDATE/DELETE/INSERT conflicts we use user locks on a pair (query_hash, fspace_hash) to guarantee that only one backend can do INSERT/UPDATE/DELETE of a aqo table row. Also we use dirty snapshot to see concurrently inserted/updated tuples. Such conflict may cause deadlocks on end-of-transaction waiting. Currently, if we detected such conflict, we refuse from we ML-base changing.
- Loading branch information
commit 2b20ff01325af14567a3d76c5c85b865a385cae7
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
expected/gucs.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
CREATE EXTENSION aqo; | ||
SET aqo.mode = 'learn'; | ||
SET aqo.show_details = true; | ||
CREATE TABLE t(x int); | ||
INSERT INTO t (x) (SELECT * FROM generate_series(1, 100) AS gs); | ||
ANALYZE t; | ||
EXPLAIN (ANALYZE, VERBOSE, COSTS OFF, TIMING OFF, SUMMARY OFF) | ||
SELECT x FROM t; | ||
QUERY PLAN | ||
--------------------------------------------------------------- | ||
Seq Scan on public.t (actual rows=100 loops=1) (AQO not used) | ||
Output: x | ||
Using aqo: true | ||
AQO mode: LEARN | ||
JOINS: 0 | ||
(5 rows) | ||
|
||
EXPLAIN (ANALYZE, VERBOSE, COSTS OFF, TIMING OFF, SUMMARY OFF) | ||
SELECT x FROM t; | ||
QUERY PLAN | ||
--------------------------------------------------------------------------------- | ||
Seq Scan on public.t (actual rows=100 loops=1) (AQO: cardinality=100, error=0%) | ||
Output: x | ||
Using aqo: true | ||
AQO mode: LEARN | ||
JOINS: 0 | ||
(5 rows) | ||
|
||
DROP EXTENSION aqo; | ||
SET aqo.log_ignorance = 'on'; | ||
SET aqo.log_ignorance = 'off'; | ||
SET aqo.log_ignorance = 'off'; | ||
SET aqo.log_ignorance = 'on'; | ||
\d | ||
List of relations | ||
Schema | Name | Type | Owner | ||
--------+------+-------+-------- | ||
public | t | table | andrey | ||
(1 row) | ||
|
||
CREATE EXTENSION aqo; | ||
SET aqo.log_ignorance = 'off'; | ||
SET aqo.log_ignorance = 'on'; | ||
SET aqo.log_ignorance = 'on'; | ||
\d aqo_ignorance | ||
Table "public.aqo_ignorance" | ||
Column | Type | Collation | Nullable | Default | ||
-----------+---------+-----------+----------+--------- | ||
qhash | integer | | | | ||
fhash | integer | | | | ||
fss_hash | integer | | | | ||
node_type | integer | | | | ||
node | text | | | | ||
Indexes: | ||
"aqo_ignorance_idx" UNIQUE, btree (qhash, fhash, fss_hash) | ||
|
||
EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF) | ||
SELECT * FROM t; | ||
QUERY PLAN | ||
-------------------------------------------------------- | ||
Seq Scan on t (actual rows=100 loops=1) (AQO not used) | ||
Using aqo: true | ||
AQO mode: LEARN | ||
JOINS: 0 | ||
(4 rows) | ||
|
||
SELECT node_type FROM aqo_ignorance; -- SeqScan on t must be existed in ignorance table | ||
node_type | ||
----------- | ||
19 | ||
(1 row) | ||
|
||
EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF) SELECT * FROM t; | ||
QUERY PLAN | ||
-------------------------------------------------------------------------- | ||
Seq Scan on t (actual rows=100 loops=1) (AQO: cardinality=100, error=0%) | ||
Using aqo: true | ||
AQO mode: LEARN | ||
JOINS: 0 | ||
(4 rows) | ||
|
||
SELECT node_type FROM aqo_ignorance; -- SeqScan on t must be excluded from ignorance table | ||
node_type | ||
----------- | ||
(0 rows) | ||
|
||
-- This GUC can be changed by an admin only. | ||
CREATE ROLE noadmin; | ||
SET ROLE noadmin; | ||
SET aqo.log_ignorance = 'off'; | ||
ERROR: permission denied to set parameter "aqo.log_ignorance" | ||
RESET ROLE; | ||
DROP EXTENSION aqo; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.