Rate This Document
Findability
Accuracy
Completeness
Readability

For Greenplum

This section uses the TPC-H model for Greenplum as an example.

  1. Switch to the installation directory.
    1
    cd HammerDB-3.2
    

  2. Run the test tool.

    You can run the help command to view the help information.

    1
    ./hammerdbcli
    

    Table 1 Common commands

    Command

    Description

    buildschema

    Creates a database table and imports data based on the configuration.

    datagenrun

    Generates the tbl data list.

    dbset

    Configures database options, including the database type and test model.

    dgset

    Configures the tbl data parameters, including the number of concurrent data generation tasks, data volume, and data storage path.

    diset

    Configures table creation parameters, such as database server addresses and database validation information, data volume, and so on.

    librarychek

    Performs the dependency verification.

    loadscript

    Loads the test parameters.

    print

    Prints the configuration information.

    quit

    Quits the tool. The original configuration is automatically cleared when you exit the tool after configuration on the CLI.

    vucreate

    Creates a task.

    vudestroy

    Stops a task.

    vurun

    Runs a task.

    vuset

    Sets task running parameters, such as the number of concurrent tasks and log configuration.

    vustatus

    Views the task execution status.

  3. Run the following commands in sequence to load data:
    dbset db pg
    dbset bm tpc-h
    diset connection pg_host 192.168.67.106
    diset tpch pg_tpch_superuser gpadmin
    diset tpch pg_tpch_superuserpass 123456
    diset tpch pg_tpch_defaultdbase postgres
    diset tpch pg_scale_fact 1
    diset tpch pg_num_tpch_threads 30
    diset tpch pg_tpch_gpcompat true
    diset tpch pg_tpch_gpcompress true

    Command

    Description

    dbset db pg

    Configures the database type.

    dbset bm tpc-h

    Configures the test model.

    diset connection pg_host 192.168.67.106

    Configures the database service address.

    diset tpch pg_tpch_superuser gpadmin

    Configures the database administrator.

    diset tpch pg_tpch_superuserpass 123456

    Configures the password of the database administrator.

    diset tpch pg_tpch_defaultdbase postgres

    Configures the default database for the database administrator.

    diset tpch pg_scale_fact 1

    Configures data volume. The default value is 1.

    diset tpch pg_num_tpch_threads 30

    Configures the concurrency.

    diset tpch pg_tpch_gpcompat tru

    Enables Greenplum compatibility.

    diset tpch pg_tpch_gpcompress true

    Enables the Greenplum parameters.

    1. View the configuration information.
      print dict

      In the preceding figure, pg_tpch_user, pg_tpch_pass, and pg_tpch_dbase are information about the newly created test database. Ensure that no user or database with the same name exists on the database server before running the command. If a user or database with the same name exists on the database server, delete it or run the diset command to modify related parameters.

      buildschema

      If message "ALL VIRTUAL USERS COMPLETE" is returned, the data is imported successfully.

    2. Run the following command:
      vustatus
      vudestroy

  4. Perform the test.
    vuset vu 1
    vuset showoutput 1
    vuset logtotemp 1
    vuset unique 1
    print vuconf

    Command

    Description

    vuset vu 1

    Configures the number of concurrent tasks.

    vuset showoutput 1

    Enables logging.

    vuset logtotemp 1

    Enables the function of automatically saving logs to /tmp.

    vuset unique 1

    Configures log uniqueness, that is, the log cannot be overwritten.

    print vuconf

    Views the configuration of a task.

    1. Load configurations.
      loadscript

    2. Create a task.
      vucreate

    3. Run the task.
      vurun

      If "SUCCESS" is returned, use the execution duration as the test metric.