-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INDEXES_WITH_NULL_VALUES] Enhance support for partitioned tables/ind…
…exes (#540) * Update queries * [INDEXES_WITH_NULL_VALUES] Enhance support for partitioned tables/indexes * Fix checkstyle
- Loading branch information
Showing
8 changed files
with
98 additions
and
5 deletions.
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
38 changes: 38 additions & 0 deletions
38
...g/core/fixtures/support/statements/CreatePartitionedTableWithNullableFieldsStatement.java
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (c) 2019-2024. Ivan Vakhrushev and others. | ||
* https://github.com/mfvanek/pg-index-health | ||
* | ||
* This file is a part of "pg-index-health" - a Java library for | ||
* analyzing and maintaining indexes health in PostgreSQL databases. | ||
* | ||
* Licensed under the Apache License 2.0 | ||
*/ | ||
|
||
package io.github.mfvanek.pg.core.fixtures.support.statements; | ||
|
||
import java.util.List; | ||
import javax.annotation.Nonnull; | ||
|
||
public class CreatePartitionedTableWithNullableFieldsStatement extends AbstractDbStatement { | ||
|
||
@Nonnull | ||
@Override | ||
protected List<String> getSqlToExecute() { | ||
return List.of( | ||
"create table if not exists {schemaName}.custom_entity_reference_with_very_very_very_long_name(" + | ||
"ref_type varchar(32)," + | ||
"ref_value varchar(64)," + | ||
"creation_date timestamp with time zone not null," + | ||
"entity_id varchar(64) not null" + | ||
") partition by range (creation_date);", | ||
"create index if not exists idx_custom_entity_reference_with_very_very_very_long_name_1 " + | ||
"on {schemaName}.custom_entity_reference_with_very_very_very_long_name (ref_type, ref_value);", | ||
"create index if not exists idx_custom_entity_reference_with_very_very_very_long_name_2 " + | ||
"on {schemaName}.custom_entity_reference_with_very_very_very_long_name (entity_id, ref_value);", | ||
"create table if not exists {schemaName}.custom_entity_reference_with_very_very_very_long_name_1_default " + | ||
"partition of {schemaName}.custom_entity_reference_with_very_very_very_long_name default;", | ||
"create index if not exists idx_custom_entity_reference_with_very_very_very_long_name_1_d_3 " + | ||
"on {schemaName}.custom_entity_reference_with_very_very_very_long_name_1_default (ref_type, ref_value);" | ||
); | ||
} | ||
} |
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