Skip to content

Commit ab075e4

Browse files
committed
Merge branch 'master' of github.com:heterodb/pg-strom
2 parents 8494394 + 846e809 commit ab075e4

14 files changed

Lines changed: 1383 additions & 519 deletions

File tree

.github/workflows/build-check.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
name: Build Check
22

33
# Run build verification after PR approval.
4+
# Temporary: also run on PR creation/update.
45
on:
6+
# pull_request:
7+
# types: [opened, synchronize, reopened]
58
pull_request_review:
69
types: [submitted]
710
push:
@@ -15,6 +18,7 @@ permissions:
1518
jobs:
1619
build:
1720
name: Build with PostgreSQL ${{ matrix.build_pgver }}
21+
# Temporary pull_request trigger disabled.
1822
if: >
1923
github.event_name == 'workflow_dispatch' ||
2024
(github.event_name == 'push' && github.actor == 'kaigai') ||
@@ -100,6 +104,7 @@ jobs:
100104
101105
regression:
102106
name: Regression with PostgreSQL ${{ matrix.test_pgver }}
107+
# Temporary pull_request trigger disabled.
103108
if: >
104109
github.event_name == 'workflow_dispatch' ||
105110
(github.event_name == 'push' && github.actor == 'kaigai') ||

src/executor.c

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2303,34 +2303,37 @@ pgstromExplainScanRelation(pgstromTaskState *pts,
23032303

23042304
initStringInfo(&buf);
23052305
snprintf(label, sizeof(label), "scan%d", ptss->scan_relidx);
2306-
appendStringInfo(&buf, "%s [plan: %.0f -> %.0f",
2307-
RelationGetRelationName(ptss->scan_rel),
2308-
ptss->plan_ntuples_raw,
2309-
ptss->plan_ntuples_in);
2310-
if (es->analyze)
2311-
{
2312-
pgstromSharedScanState *psss = ptss->dsm;
2313-
uint64_t source_ntuples_raw = pg_atomic_read_u64(&psss->source_ntuples_raw);
2314-
uint64_t source_ntuples_in = pg_atomic_read_u64(&psss->source_ntuples_in);
2315-
uint32_t nchunks_parquet_read = pg_atomic_read_u32(&psss->nchunks_parquet_read);
2316-
uint32_t ncaches_parquet_load = pg_atomic_read_u32(&psss->ncaches_parquet_load);
2317-
2318-
appendStringInfo(&buf, ", exec: %lu -> %lu",
2306+
appendStringInfoString(&buf, RelationGetRelationName(ptss->scan_rel));
2307+
if (!pgstrom_regression_test_mode)
2308+
{
2309+
appendStringInfo(&buf, " [plan: %.0f -> %.0f",
2310+
ptss->plan_ntuples_raw,
2311+
ptss->plan_ntuples_in);
2312+
if (es->analyze)
2313+
{
2314+
pgstromSharedScanState *psss = ptss->dsm;
2315+
uint64_t source_ntuples_raw = pg_atomic_read_u64(&psss->source_ntuples_raw);
2316+
uint64_t source_ntuples_in = pg_atomic_read_u64(&psss->source_ntuples_in);
2317+
uint32_t nchunks_parquet_read = pg_atomic_read_u32(&psss->nchunks_parquet_read);
2318+
uint32_t ncaches_parquet_load = pg_atomic_read_u32(&psss->ncaches_parquet_load);
2319+
2320+
appendStringInfo(&buf, ", exec: %lu -> %lu",
23192321
source_ntuples_raw,
23202322
source_ntuples_in);
2321-
/* parquet-cache stats */
2322-
if (!pgstrom_explain_developer_mode && nchunks_parquet_read > 0)
2323-
{
2324-
appendStringInfo(&buf, "cache-hit: %u of total %u chunks (cache ratio: %.2f%%)",
2323+
/* parquet-cache stats */
2324+
if (!pgstrom_explain_developer_mode && nchunks_parquet_read > 0)
2325+
{
2326+
appendStringInfo(&buf, "cache-hit: %u of total %u chunks (cache ratio: %.2f%%)",
23252327
ncaches_parquet_load,
23262328
ncaches_parquet_load + nchunks_parquet_read,
23272329
100.0 *
23282330
(double)ncaches_parquet_load /
23292331
(double)(ncaches_parquet_load + nchunks_parquet_read));
2332+
}
23302333
}
2334+
//TODO: add execution time for each
2335+
appendStringInfo(&buf, "]");
23312336
}
2332-
//TODO: add execution time for each
2333-
appendStringInfo(&buf, "]");
23342337
ExplainPropertyText(label, buf.data, es);
23352338

23362339
if (ptss->arrow_state)

test/16/expected/arrow_index.out

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ SELECT * FROM regtest_arrow_index_temp.regtest_arrow
5858
-> Seq Scan on target_num (actual rows=1 loops=1)
5959
-> Parallel Custom Scan (GpuScan) on regtest_arrow (actual rows=90 loops=3)
6060
GPU Projection: id, int_num, float_num, half_num, decimal_num, date_num, time_num, timestamp_num
61-
GPU Scan Quals: (date_num = $0) [exec: 310689 -> 269]
62-
referenced: id, int_num, float_num, half_num, decimal_num, date_num, time_num, timestamp_num
61+
referenced: id, int_num, float_num, half_num, decimal_num, date_num, time_num
62+
GPU Scan Quals: (date_num = $0) [exec: 0 -> 0]
6363
Stats-Hint: (date_num = $0) [loaded: 1, skipped: 3]
6464
file0: test_arrow_index.data (read: 51.50MB, size: 51.50MB)
6565
(12 rows)
@@ -68,14 +68,14 @@ EXPLAIN (ANALYZE,COSTS OFF,TIMING OFF,SUMMARY OFF,BUFFERS OFF)
6868
SELECT count(*)
6969
FROM regtest_arrow
7070
WHERE date_num between '2019-04-14' and '2023-05-23';
71-
QUERY PLAN
72-
--------------------------------------------------------------------------------------------------------------------------
71+
QUERY PLAN
72+
-----------------------------------------------------------------------------------------------------------------
7373
Aggregate (actual rows=1 loops=1)
7474
-> Custom Scan (GpuPreAgg) on regtest_arrow (actual rows=1 loops=1)
7575
GPU Projection: pgstrom.nrows()
76-
GPU Scan Quals: ((date_num >= '04-14-2019'::date) AND (date_num <= '05-23-2023'::date)) [exec: 621378 -> 374353]
77-
GPU Group Key:
7876
referenced: date_num
77+
GPU Scan Quals: ((date_num >= '04-14-2019'::date) AND (date_num <= '05-23-2023'::date)) [exec: 0 -> 0]
78+
GPU Group Key:
7979
Stats-Hint: (date_num >= '04-14-2019'::date), (date_num <= '05-23-2023'::date) [loaded: 2, skipped: 2]
8080
file0: test_arrow_index.data (read: 3906.25KB, size: 51.50MB)
8181
(8 rows)
@@ -113,8 +113,8 @@ SELECT * FROM regtest_arrow_index_temp.regtest_arrow
113113
-> Seq Scan on target_num (actual rows=1 loops=1)
114114
-> Parallel Custom Scan (GpuScan) on regtest_arrow (actual rows=0 loops=3)
115115
GPU Projection: id, int_num, float_num, half_num, decimal_num, date_num, time_num, timestamp_num
116-
GPU Scan Quals: (int_num = $0) [exec: 310689 -> 1]
117-
referenced: id, int_num, float_num, half_num, decimal_num, date_num, time_num, timestamp_num
116+
referenced: id, int_num, float_num, half_num, decimal_num, date_num, time_num
117+
GPU Scan Quals: (int_num = $0) [exec: 0 -> 0]
118118
Stats-Hint: (int_num = $0) [loaded: 1, skipped: 3]
119119
file0: test_arrow_index.data (read: 51.50MB, size: 51.50MB)
120120
(12 rows)
@@ -123,14 +123,14 @@ EXPLAIN (ANALYZE,COSTS OFF,TIMING OFF,SUMMARY OFF,BUFFERS OFF)
123123
SELECT count(*)
124124
FROM regtest_arrow
125125
WHERE int_num between -50000 and 50000;
126-
QUERY PLAN
127-
--------------------------------------------------------------------------------------------------------
126+
QUERY PLAN
127+
-------------------------------------------------------------------------------------------------
128128
Aggregate (actual rows=1 loops=1)
129129
-> Custom Scan (GpuPreAgg) on regtest_arrow (actual rows=1 loops=1)
130130
GPU Projection: pgstrom.nrows()
131-
GPU Scan Quals: ((int_num >= '-50000'::integer) AND (int_num <= 50000)) [exec: 310689 -> 2941]
132-
GPU Group Key:
133131
referenced: int_num
132+
GPU Scan Quals: ((int_num >= '-50000'::integer) AND (int_num <= 50000)) [exec: 0 -> 0]
133+
GPU Group Key:
134134
Stats-Hint: (int_num >= '-50000'::integer), (int_num <= 50000) [loaded: 1, skipped: 3]
135135
file0: test_arrow_index.data (read: 3906.25KB, size: 51.50MB)
136136
(8 rows)
@@ -168,8 +168,8 @@ SELECT * FROM regtest_arrow_index_temp.regtest_arrow
168168
-> Seq Scan on target_num (actual rows=1 loops=1)
169169
-> Parallel Custom Scan (GpuScan) on regtest_arrow (actual rows=0 loops=3)
170170
GPU Projection: id, int_num, float_num, half_num, decimal_num, date_num, time_num, timestamp_num
171-
GPU Scan Quals: (float_num = $0) [exec: 310689 -> 1]
172-
referenced: id, int_num, float_num, half_num, decimal_num, date_num, time_num, timestamp_num
171+
referenced: id, int_num, float_num, half_num, decimal_num, date_num, time_num
172+
GPU Scan Quals: (float_num = $0) [exec: 0 -> 0]
173173
Stats-Hint: (float_num = $0) [loaded: 1, skipped: 3]
174174
file0: test_arrow_index.data (read: 51.50MB, size: 51.50MB)
175175
(12 rows)
@@ -178,14 +178,14 @@ EXPLAIN (ANALYZE,COSTS OFF,TIMING OFF,SUMMARY OFF,BUFFERS OFF)
178178
SELECT count(*)
179179
FROM regtest_arrow
180180
WHERE float_num between -2000 and 2000;
181-
QUERY PLAN
182-
-----------------------------------------------------------------------------------------------------------------------------------------
181+
QUERY PLAN
182+
--------------------------------------------------------------------------------------------------------------------------------
183183
Aggregate (actual rows=1 loops=1)
184184
-> Custom Scan (GpuPreAgg) on regtest_arrow (actual rows=1 loops=1)
185185
GPU Projection: pgstrom.nrows()
186-
GPU Scan Quals: ((float_num >= '-2000'::double precision) AND (float_num <= '2000'::double precision)) [exec: 310689 -> 200036]
187-
GPU Group Key:
188186
referenced: float_num
187+
GPU Scan Quals: ((float_num >= '-2000'::double precision) AND (float_num <= '2000'::double precision)) [exec: 0 -> 0]
188+
GPU Group Key:
189189
Stats-Hint: (float_num >= '-2000'::double precision), (float_num <= '2000'::double precision) [loaded: 1, skipped: 3]
190190
file0: test_arrow_index.data (read: 7812.50KB, size: 51.50MB)
191191
(8 rows)
@@ -223,23 +223,23 @@ SELECT * FROM regtest_arrow_index_temp.regtest_arrow
223223
-> Seq Scan on target_num (actual rows=1 loops=1)
224224
-> Parallel Custom Scan (GpuScan) on regtest_arrow (actual rows=5 loops=3)
225225
GPU Projection: id, int_num, float_num, half_num, decimal_num, date_num, time_num, timestamp_num
226-
GPU Scan Quals: (half_num = $0) [exec: 1000000 -> 15]
227-
referenced: id, int_num, float_num, half_num, decimal_num, date_num, time_num, timestamp_num
226+
referenced: id, int_num, float_num, half_num, decimal_num, date_num, time_num
227+
GPU Scan Quals: (half_num = $0) [exec: 0 -> 0]
228228
file0: test_arrow_index.data (read: 51.50MB, size: 51.50MB)
229229
(11 rows)
230230

231231
EXPLAIN (ANALYZE,COSTS OFF,TIMING OFF,SUMMARY OFF,BUFFERS OFF)
232232
SELECT count(*)
233233
FROM regtest_arrow
234234
WHERE half_num between -2000 and 2000;
235-
QUERY PLAN
236-
----------------------------------------------------------------------------------------------------------------------------------------
235+
QUERY PLAN
236+
-----------------------------------------------------------------------------------------------------------------------------
237237
Aggregate (actual rows=1 loops=1)
238238
-> Custom Scan (GpuPreAgg) on regtest_arrow (actual rows=1 loops=1)
239239
GPU Projection: pgstrom.nrows()
240-
GPU Scan Quals: ((half_num >= '-2000'::double precision) AND (half_num <= '2000'::double precision)) [exec: 1000000 -> 199782]
241-
GPU Group Key:
242240
referenced: half_num
241+
GPU Scan Quals: ((half_num >= '-2000'::double precision) AND (half_num <= '2000'::double precision)) [exec: 0 -> 0]
242+
GPU Group Key:
243243
file0: test_arrow_index.data (read: 1953.12KB, size: 51.50MB)
244244
(7 rows)
245245

@@ -276,8 +276,8 @@ SELECT * FROM regtest_arrow_index_temp.regtest_arrow
276276
-> Seq Scan on target_num (actual rows=1 loops=1)
277277
-> Parallel Custom Scan (GpuScan) on regtest_arrow (actual rows=0 loops=3)
278278
GPU Projection: id, int_num, float_num, half_num, decimal_num, date_num, time_num, timestamp_num
279-
GPU Scan Quals: (decimal_num = $0) [exec: 310689 -> 0]
280-
referenced: id, int_num, float_num, half_num, decimal_num, date_num, time_num, timestamp_num
279+
referenced: id, int_num, float_num, half_num, decimal_num, date_num, time_num
280+
GPU Scan Quals: (decimal_num = $0) [exec: 0 -> 0]
281281
Stats-Hint: (decimal_num = $0) [loaded: 1, skipped: 3]
282282
file0: test_arrow_index.data (read: 51.50MB, size: 51.50MB)
283283
(12 rows)
@@ -286,14 +286,14 @@ EXPLAIN (ANALYZE,COSTS OFF,TIMING OFF,SUMMARY OFF,BUFFERS OFF)
286286
SELECT count(*)
287287
FROM regtest_arrow
288288
WHERE decimal_num between -5000 and 5000;
289-
QUERY PLAN
290-
---------------------------------------------------------------------------------------------------------------------------
289+
QUERY PLAN
290+
------------------------------------------------------------------------------------------------------------------
291291
Aggregate (actual rows=1 loops=1)
292292
-> Custom Scan (GpuPreAgg) on regtest_arrow (actual rows=1 loops=1)
293293
GPU Projection: pgstrom.nrows()
294-
GPU Scan Quals: ((decimal_num >= '-5000'::numeric) AND (decimal_num <= '5000'::numeric)) [exec: 932067 -> 500583]
295-
GPU Group Key:
296294
referenced: decimal_num
295+
GPU Scan Quals: ((decimal_num >= '-5000'::numeric) AND (decimal_num <= '5000'::numeric)) [exec: 0 -> 0]
296+
GPU Group Key:
297297
Stats-Hint: (decimal_num >= '-5000'::numeric), (decimal_num <= '5000'::numeric) [loaded: 3, skipped: 1]
298298
file0: test_arrow_index.data (read: 15.26MB, size: 51.50MB)
299299
(8 rows)
@@ -331,8 +331,8 @@ SELECT * FROM regtest_arrow_index_temp.regtest_arrow
331331
-> Seq Scan on target_num (actual rows=1 loops=1)
332332
-> Parallel Custom Scan (GpuScan) on regtest_arrow (actual rows=0 loops=3)
333333
GPU Projection: id, int_num, float_num, half_num, decimal_num, date_num, time_num, timestamp_num
334-
GPU Scan Quals: (time_num = $0) [exec: 310689 -> 1]
335-
referenced: id, int_num, float_num, half_num, decimal_num, date_num, time_num, timestamp_num
334+
referenced: id, int_num, float_num, half_num, decimal_num, date_num, time_num
335+
GPU Scan Quals: (time_num = $0) [exec: 0 -> 0]
336336
Stats-Hint: (time_num = $0) [loaded: 1, skipped: 3]
337337
file0: test_arrow_index.data (read: 51.50MB, size: 51.50MB)
338338
(12 rows)
@@ -341,14 +341,14 @@ EXPLAIN (ANALYZE,COSTS OFF,TIMING OFF,SUMMARY OFF,BUFFERS OFF)
341341
SELECT count(*)
342342
FROM regtest_arrow
343343
WHERE time_num between '09:00:00' and '17:00:00';
344-
QUERY PLAN
345-
----------------------------------------------------------------------------------------------------------------------------------------------------------
344+
QUERY PLAN
345+
-------------------------------------------------------------------------------------------------------------------------------------------------
346346
Aggregate (actual rows=1 loops=1)
347347
-> Custom Scan (GpuPreAgg) on regtest_arrow (actual rows=1 loops=1)
348348
GPU Projection: pgstrom.nrows()
349-
GPU Scan Quals: ((time_num >= '09:00:00'::time without time zone) AND (time_num <= '17:00:00'::time without time zone)) [exec: 621378 -> 333443]
350-
GPU Group Key:
351349
referenced: time_num
350+
GPU Scan Quals: ((time_num >= '09:00:00'::time without time zone) AND (time_num <= '17:00:00'::time without time zone)) [exec: 0 -> 0]
351+
GPU Group Key:
352352
Stats-Hint: (time_num >= '09:00:00'::time without time zone), (time_num <= '17:00:00'::time without time zone) [loaded: 2, skipped: 2]
353353
file0: test_arrow_index.data (read: 7812.50KB, size: 51.50MB)
354354
(8 rows)
@@ -386,8 +386,8 @@ WHERE timestamp_num=(SELECT timestamp_num FROM regtest_arrow_index_temp.target_n
386386
-> Seq Scan on target_num (actual rows=1 loops=1)
387387
-> Parallel Custom Scan (GpuScan) on regtest_arrow (actual rows=0 loops=3)
388388
GPU Projection: id, int_num, float_num, half_num, decimal_num, date_num, time_num, timestamp_num
389-
GPU Scan Quals: (timestamp_num = $0) [exec: 310689 -> 1]
390-
referenced: id, int_num, float_num, half_num, decimal_num, date_num, time_num, timestamp_num
389+
referenced: id, int_num, float_num, half_num, decimal_num, date_num, time_num
390+
GPU Scan Quals: (timestamp_num = $0) [exec: 0 -> 0]
391391
Stats-Hint: (timestamp_num = $0) [loaded: 1, skipped: 3]
392392
file0: test_arrow_index.data (read: 51.50MB, size: 51.50MB)
393393
(12 rows)
@@ -396,14 +396,14 @@ EXPLAIN (ANALYZE,COSTS OFF,TIMING OFF,SUMMARY OFF,BUFFERS OFF)
396396
SELECT count(*)
397397
FROM regtest_arrow
398398
WHERE timestamp_num between '2019-04-14 09:00:00' and '2023-05-23 17:00:00';
399-
QUERY PLAN
400-
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
399+
QUERY PLAN
400+
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
401401
Aggregate (actual rows=1 loops=1)
402402
-> Custom Scan (GpuPreAgg) on regtest_arrow (actual rows=1 loops=1)
403403
GPU Projection: pgstrom.nrows()
404-
GPU Scan Quals: ((timestamp_num >= 'Sun Apr 14 09:00:00 2019'::timestamp without time zone) AND (timestamp_num <= 'Tue May 23 17:00:00 2023'::timestamp without time zone)) [exec: 621378 -> 410884]
404+
referenced:
405+
GPU Scan Quals: ((timestamp_num >= 'Sun Apr 14 09:00:00 2019'::timestamp without time zone) AND (timestamp_num <= 'Tue May 23 17:00:00 2023'::timestamp without time zone)) [exec: 0 -> 0]
405406
GPU Group Key:
406-
referenced: timestamp_num
407407
Stats-Hint: (timestamp_num >= 'Sun Apr 14 09:00:00 2019'::timestamp without time zone), (timestamp_num <= 'Tue May 23 17:00:00 2023'::timestamp without time zone) [loaded: 2, skipped: 2]
408408
file0: test_arrow_index.data (read: 7812.50KB, size: 51.50MB)
409409
(8 rows)

0 commit comments

Comments
 (0)