Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GPU Logic Bug] SELECT COUNT(<number>) FROM <table> LEFT OUTER JOIN <table> ON <column> Brings GPU Logic Bug #829

Open
qwebug opened this issue Oct 9, 2024 · 1 comment
Labels
wait for confirmation developer solved this problem, and wait for confirmation by the user

Comments

@qwebug
Copy link

qwebug commented Oct 9, 2024

Describe:

SELECT COUNT(<number>) FROM <table> LEFT OUTER JOIN <table> ON <column> brings different results, when using CPU-only configurations and GPU-used configurations.

SQL with CPU-only Config:

CREATE TABLE t0(c0 int4range, c1 boolean);
CREATE TABLE t3(LIKE t0);
CREATE TABLE t4(LIKE t0);
INSERT INTO t4(c0, c1) VALUES('[-3,-1)'::int4range, FALSE);
INSERT INTO t0(c0, c1) VALUES('[-2,5]'::int4range, TRUE);
INSERT INTO t3(c0) VALUES('(-4,6]'::int4range);
CREATE SCHEMA extensions;
CREATE EXTENSION pg_strom WITH SCHEMA extensions;
SET pg_strom.enabled=off;
SELECT COUNT(0) FROM t3, t4 LEFT OUTER JOIN t0 ON t4.c1;

Result:

 count 
-------
     1
(1 row)

SQL with GPU-used Config:

SET pg_strom.enabled=on;
SELECT COUNT(0) FROM t3, t4 LEFT OUTER JOIN t0 ON t4.c1;

Result:

 count 
-------
     0
(1 row)

Environment:

Pg-strom Version: commit 9765660

PostgreSQL Version: 15.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-20), 64-bit

CUDA Version: 12.2

NVIDIA Driver Version: 535.171.04

kaigai added a commit that referenced this issue Oct 16, 2024
… given as an argument.

this issue was reported #829
@kaigai
Copy link
Contributor

kaigai commented Oct 16, 2024

ff92fbbc52b3b3d7a517f5905024250939c6294f should fix this problem.

pgstrom.nrows(0) (that is an alternative function for CPU fallback / RIGHT OUTER tuples) didn't return correct value, if binary form of the argument can be considered as false in boolean.

@kaigai kaigai added the wait for confirmation developer solved this problem, and wait for confirmation by the user label Oct 16, 2024
kaigai added a commit that referenced this issue Oct 17, 2024
issue #829

We already have partition-wise GpuJoin.
Nowadays, most people use table partitioning rather than traditional
table inheritances, and it is more functional.
So, we simply skip to add GPU-paths on the inheritance tables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wait for confirmation developer solved this problem, and wait for confirmation by the user
Projects
None yet
Development

No branches or pull requests

2 participants