From 3c4fb59e0fa17907837f187e5bcbde651866c14b Mon Sep 17 00:00:00 2001 From: Jan Mercl <0xjnml@gmail.com> Date: Fri, 15 Jan 2021 17:22:10 +0100 Subject: [PATCH] tpch: remove _property table --- Makefile | 2 +- tpch/dbgen.go | 15 +-------------- tpch/driver/driver.go | 1 - tpch/driver/drivers/sqlite3.go | 10 ---------- tpch/main.go | 15 +++++++++++++++ tpch/q.go | 3 +-- 6 files changed, 18 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index 97ebb34..08d6427 100644 --- a/Makefile +++ b/Makefile @@ -116,7 +116,7 @@ edit: editor: gofmt -l -s -w *.go - go install -v ./... + GO111MODULE=off go install -v ./... internalError: egrep -ho '"internal error.*"' *.go | sort | cat -n diff --git a/tpch/dbgen.go b/tpch/dbgen.go index 96be74f..8169e55 100644 --- a/tpch/dbgen.go +++ b/tpch/dbgen.go @@ -672,20 +672,7 @@ func dbGen(sut driver.SUT, sf int) (err error) { return err } - if err = genRegion(db, sf, sut); err != nil { - return err - } - - tx, err := db.Begin() - if err != nil { - return err - } - - if _, err = tx.Exec(sut.InsertProperty(), time.Now(), int64(sf), int64(maxRecs)); err != nil { - return err - } - - return tx.Commit() + return genRegion(db, sf, sut) } func genSupplier(db *sql.DB, sf int, sut driver.SUT) (err error) { diff --git a/tpch/driver/driver.go b/tpch/driver/driver.go index eba2f29..6ea8df9 100644 --- a/tpch/driver/driver.go +++ b/tpch/driver/driver.go @@ -18,7 +18,6 @@ type SUT interface { InsertOrders() string InsertPart() string InsertPartSupp() string - InsertProperty() string InsertRegion() string InsertSupplier() string Name() string diff --git a/tpch/driver/drivers/sqlite3.go b/tpch/driver/drivers/sqlite3.go index ff4d6f1..e4f2820 100644 --- a/tpch/driver/drivers/sqlite3.go +++ b/tpch/driver/drivers/sqlite3.go @@ -210,12 +210,6 @@ func (b *sqlite3) CreateTables() error { r_comment string ); - create table _property ( - ctime time, - sf int, - recs int - ); - `); err != nil { return err } @@ -255,10 +249,6 @@ func (b *sqlite3) InsertRegion() string { return "insert into region values (?1, ?2, ?3)" } -func (b *sqlite3) InsertProperty() string { - return "insert into _property values (?1, ?2, ?3)" -} - func (b *sqlite3) QProperty() string { return "select * from _property" } diff --git a/tpch/main.go b/tpch/main.go index f2d2f07..2c13ce0 100644 --- a/tpch/main.go +++ b/tpch/main.go @@ -2,6 +2,21 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// TPC BENCHMARK TM H +// (Decision Support) +// Standard Specification +// Revision 2.17.1 +// +// Transaction Processing Performance Council (TPC) +// Presidio of San Francisco +// Building 572B Ruger St. (surface) +// P.O. Box 29920 (mail) +// San Francisco, CA 94129-0920 +// Voice:415-561-6272 +// Fax:415-561-6120 +// Email: webmaster@tpc.org +// © 1993 - 2014 Transaction Processing Performance Council + package main import ( diff --git a/tpch/q.go b/tpch/q.go index 323c3a1..0d02892 100644 --- a/tpch/q.go +++ b/tpch/q.go @@ -18,7 +18,6 @@ func cpDB(sut driver.SUT, src, dest *sql.DB) error { t, i string int }{ - {"_property", sut.InsertProperty(), 3}, {"customer", sut.InsertCustomer(), 8}, {"lineitem", sut.InsertLineItem(), 16}, {"nation", sut.InsertNation(), 4}, @@ -136,7 +135,7 @@ func run(sut driver.SUT, mem bool, n, sf int, verbose bool) (err error) { t0 := time.Now() defer func() { - fmt.Println(time.Since(t0)) //TODO -> result.db + fmt.Println(time.Since(t0)) }() switch n {