-
Notifications
You must be signed in to change notification settings - Fork 23
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
Make room for other database engines #1139
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -81,7 +81,7 @@ sub create_schema { | |
) or die Zonemaster::Backend::Error::Internal->new( reason => "PostgreSQL error, could not create 'test_results' table", data => $dbh->errstr() ); | ||
|
||
$dbh->do( | ||
'CREATE INDEX IF NOT EXISTS test_results__hash_id ON test_results (hash_id)' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we still need an index for just hash_id? E.g. for the |
||
'CREATE INDEX IF NOT EXISTS test_results__hash_id_created_at ON test_results (hash_id, created_at)' | ||
); | ||
$dbh->do( | ||
'CREATE INDEX IF NOT EXISTS test_results__fingerprint ON test_results (fingerprint)' | ||
|
@@ -222,7 +222,7 @@ sub add_batch_job { | |
|
||
my $dbh = $self->dbh; | ||
|
||
if ( $self->user_authorized( $params->{username}, $params->{api_key} ) ) { | ||
if ( 1 == $self->user_authorized( $params->{username}, $params->{api_key} ) ) { | ||
$batch_id = $self->create_new_batch_job( $params->{username} ); | ||
|
||
my $test_params = $params->{test_params}; | ||
|
@@ -234,7 +234,7 @@ sub add_batch_job { | |
|
||
$dbh->begin_work(); | ||
$dbh->do( "ALTER TABLE test_results DROP CONSTRAINT IF EXISTS test_results_pkey" ); | ||
$dbh->do( "DROP INDEX IF EXISTS test_results__hash_id" ); | ||
$dbh->do( "DROP INDEX IF EXISTS test_results__hash_id_created_at" ); | ||
$dbh->do( "DROP INDEX IF EXISTS test_results__fingerprint" ); | ||
$dbh->do( "DROP INDEX IF EXISTS test_results__batch_id_progress" ); | ||
$dbh->do( "DROP INDEX IF EXISTS test_results__progress" ); | ||
|
@@ -271,7 +271,7 @@ sub add_batch_job { | |
} | ||
$dbh->pg_putcopyend(); | ||
$dbh->do( "ALTER TABLE test_results ADD PRIMARY KEY (id)" ); | ||
$dbh->do( "CREATE INDEX test_results__hash_id ON test_results (hash_id, created_at)" ); | ||
$dbh->do( "CREATE INDEX test_results__hash_id_created_at ON test_results (hash_id, created_at)" ); | ||
$dbh->do( "CREATE INDEX test_results__fingerprint ON test_results (fingerprint)" ); | ||
$dbh->do( "CREATE INDEX test_results__batch_id_progress ON test_results (batch_id, progress)" ); | ||
$dbh->do( "CREATE INDEX test_results__progress ON test_results (progress)" ); | ||
|
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong to me but maybe it just me reading it wrong. Doesn't this joined test_results shadow the test_results in the outer select? If it is, doesn't that mean that the count includes all entries for all tests just as long as they have the right level?