Skip to content

Commit

Permalink
tpch: remove _property table
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Mercl committed Jan 15, 2021
1 parent d0a6fb6 commit 3c4fb59
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 1 addition & 14 deletions tpch/dbgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion tpch/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ type SUT interface {
InsertOrders() string
InsertPart() string
InsertPartSupp() string
InsertProperty() string
InsertRegion() string
InsertSupplier() string
Name() string
Expand Down
10 changes: 0 additions & 10 deletions tpch/driver/drivers/sqlite3.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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"
}
Expand Down
15 changes: 15 additions & 0 deletions tpch/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
// © 1993 - 2014 Transaction Processing Performance Council

package main

import (
Expand Down
3 changes: 1 addition & 2 deletions tpch/q.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 3c4fb59

Please sign in to comment.