File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
frameworks/Kotlin/hexagon
store_pgclient/src/main/kotlin
store_sql/src/main/kotlin Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,10 @@ class BenchmarkPgClientStore(
19
19
) : BenchmarkStore(settings) {
20
20
21
21
companion object {
22
- private const val SELECT_WORLD : String = " select * from world where id = $1"
22
+ private const val LOAD_WORLDS : String = " select id, randomNumber from world"
23
+ private const val SELECT_WORLD : String = " select id, randomNumber from world where id = $1"
23
24
private const val UPDATE_WORLD : String = " update world set randomNumber = $1 where id = $2"
24
- private const val SELECT_ALL_FORTUNES : String = " select * from fortune"
25
+ private const val SELECT_ALL_FORTUNES : String = " select id, message from fortune"
25
26
}
26
27
27
28
private val connectOptions: PgConnectOptions by lazy {
@@ -81,13 +82,12 @@ class BenchmarkPgClientStore(
81
82
.toCompletionStage()
82
83
.toCompletableFuture()
83
84
.get()
84
-
85
85
}
86
86
}
87
87
88
88
override fun initWorldsCache (cache : Cache <Int , CachedWorld >) {
89
89
dataSource
90
- .preparedQuery(" select * from world " )
90
+ .preparedQuery(LOAD_WORLDS )
91
91
.execute()
92
92
.map { rowSet ->
93
93
rowSet.map { row ->
Original file line number Diff line number Diff line change @@ -16,9 +16,10 @@ class BenchmarkSqlStore(
16
16
) : BenchmarkStore(settings) {
17
17
18
18
companion object {
19
- private const val SELECT_WORLD : String = " select * from world where id = ?"
19
+ private const val LOAD_WORLDS : String = " select id, randomNumber from world"
20
+ private const val SELECT_WORLD : String = " select id, randomNumber from world where id = ?"
20
21
private const val UPDATE_WORLD : String = " update world set randomNumber = ? where id = ?"
21
- private const val SELECT_ALL_FORTUNES : String = " select * from fortune"
22
+ private const val SELECT_ALL_FORTUNES : String = " select id, message from fortune"
22
23
}
23
24
24
25
private val dataSource: HikariDataSource by lazy {
@@ -87,7 +88,7 @@ class BenchmarkSqlStore(
87
88
88
89
override fun initWorldsCache (cache : Cache <Int , CachedWorld >) {
89
90
dataSource.connection.use { con: Connection ->
90
- val stmtSelect = con.prepareStatement(" select * from world " )
91
+ val stmtSelect = con.prepareStatement(LOAD_WORLDS )
91
92
val rs = stmtSelect.executeQuery()
92
93
93
94
while (rs.next()) {
You can’t perform that action at this time.
0 commit comments