hezean / sustc

Template for project 2 of SUSTech Principles of Database Systems (CS307 / CS213), 23 fall semester.
http://172.18.34.154
MIT License
22 stars 9 forks source link

How to avoid data import multiple times? #73

Closed Flitieter closed 8 months ago

Flitieter commented 8 months ago

Describe your question

Every time I run the benchmark, I notice the data import runs again, which costs me a lot of time. So is there a way to avoid this case?

WhatWEat commented 8 months ago

Step 1: Using PostgreSQL's COPY Feature

  1. PostgreSQL provides a COPY functionality that can be used to back up data from the public schema to another schema.
  2. This operation can be performed visually in DataGrip.
    • Right-click on the schema and select the Import/Export option.
    • Here, you will find the option copy table to....
    • Alternatively, you can select the schema and press F5 as a shortcut.

Step 2: Modifying benchservice.java

  1. In the benchservice.java file, comment out the steps involving truncate and db import for order = 0 and order = 1.
  2. After completing the above steps, every time you modify data in the public schema, you can drop it and then repeat the process to copy a backed-up version.

Important Note: