Skip to content
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

MSSQLS TPCH Add Flag to Partition Orders and Lineitems #647

Merged
merged 2 commits into from
Dec 7, 2023

Conversation

JoshInnis
Copy link
Contributor

Added a flag that allows the Order and Lineitem tables to be partitioned. Each partition spans 1 week. The parition flag is set to false by default and must be enabled.

Column Store and Row store are allowed to be partitioned.

When paritioning is enabled. Certain primary and foreign key definitions defined in HammerDB are no longer valid. HammerDB will still create those keys/constraints when the Orders and Lineitem tables are not partitioned.`

For columnstore indices, the is an initial degredation of performance, however if the user calls Alter Index ... Reoganize or leaves the server running after the initial load for approximately 48 hours, the performance of power runs improves by 2x when compared to column store indices with no partitioning.

Added a flag that allows the Order and Lineitem tables to be
partitioned. Each partition spans 1 week. The parition flag is set to
false by default and must be enabled.

Column Store and Row store are allowed to be partitioned.

When paritioning is enabled. Certain primary and foreign key definitions
defined in HammerDB are no longer valid. HammerDB will still create
those keys/constraints when the Orders and Lineitem  tables are not
partitioned.`

For columnstore indices, the is an initial degredation of performance,
however if the user calls Alter Index ... Reoganize or leaves the server
running after the initial load for approximately 48 hours, the
performance of power runs improves by 2x when compared to column store
indices with no partitioning.
Copy link
Contributor

@sm-shaw sm-shaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have tested multiple combinations of build and test and all work apart from the following scenario where the refresh function is enabled in the driver script when the partitioning option has been selected. In this scenario both types of build error with a constraint doesn't exist error. This is when in the refresh function the following is called to allow the refresh function to insert into lineitem first before orders.

$odbc evaldirect "ALTER TABLE LINEITEM NOCHECK CONSTRAINT LINEITEM_ORDER_FK"

The error is the same as follows:
partition orders and lineitem with no clustered columnstore


Error in Virtual User 1: Error: [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Constraint 'LINEITEM_ORDER_FK' does not exist.
[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Could not enable or disable the constraint. See previous errors.
(executing the statement)

partition orders and lineitem with clustered columnstore

Error in Virtual User 1: Error: [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Constraint 'LINEITEM_ORDER_FK' does not exist.
[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Could not enable or disable the constraint. See previous errors.
(executing the statement)

The fix could be to check if the constraint exists before disabling or re-enabling - or to add a catch statement and ignore failure if the error message from the catch says that the constraint doesn't exist.

When the refresh was being used in a run, a constraint that
no longer existed was being altered at several stages. Update
refresh logic to bypass altering this index when it does not
exist.
@JoshInnis
Copy link
Contributor Author

JoshInnis commented Dec 6, 2023

Updated PR to handle the issue found.

Copy link
Contributor

@sm-shaw sm-shaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all works and OK to accept the changes. Just to note in testing on a row store of 10WH the old sales refresh when running a power test (set VU to 1 and enable refresh function) completed in 185 secs with partitioning enabled and no foreign key compared to 0.967 for the default schema. The column store was also taking much longer on old sales refresh. Therefore this is something to be noted in the documentation when partitioning is used that it is known that the refresh function takes much longer.

@abondvt89 abondvt89 merged commit e7c4e08 into TPC-Council:master Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants