-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicilty convert FLOAT4/FLOAT8 values before filter operation
- Loading branch information
Showing
4 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
CREATE TABLE query_filter_int(a INT); | ||
INSERT INTO query_filter_int SELECT g FROM generate_series(1,100) g; | ||
SELECT COUNT(*) FROM query_filter_int WHERE a <= 50; | ||
count | ||
------- | ||
50 | ||
(1 row) | ||
|
||
DROP TABLE query_filter_int; | ||
CREATE TABLE query_filter_float(a FLOAT8); | ||
INSERT INTO query_filter_float VALUES (0.9), (1.0), (1.1); | ||
SELECT COUNT(*) = 1 FROM query_filter_float WHERE a < 1.0; | ||
?column? | ||
---------- | ||
t | ||
(1 row) | ||
|
||
SELECT COUNT(*) = 2 FROM query_filter_float WHERE a <= 1.0; | ||
?column? | ||
---------- | ||
t | ||
(1 row) | ||
|
||
SELECT COUNT(*) = 2 FROM query_filter_float WHERE a < 1.1; | ||
?column? | ||
---------- | ||
t | ||
(1 row) | ||
|
||
DROP TABLE query_filter_float; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE TABLE query_filter_int(a INT); | ||
INSERT INTO query_filter_int SELECT g FROM generate_series(1,100) g; | ||
SELECT COUNT(*) FROM query_filter_int WHERE a <= 50; | ||
DROP TABLE query_filter_int; | ||
|
||
CREATE TABLE query_filter_float(a FLOAT8); | ||
INSERT INTO query_filter_float VALUES (0.9), (1.0), (1.1); | ||
SELECT COUNT(*) = 1 FROM query_filter_float WHERE a < 1.0; | ||
SELECT COUNT(*) = 2 FROM query_filter_float WHERE a <= 1.0; | ||
SELECT COUNT(*) = 2 FROM query_filter_float WHERE a < 1.1; | ||
|
||
DROP TABLE query_filter_float; |