| 1 |
set enable_seqscan=off; |
| 2 |
CREATE TABLE test_time ( |
| 3 |
i time |
| 4 |
); |
| 5 |
INSERT INTO test_time VALUES |
| 6 |
( '03:55:08' ), |
| 7 |
( '04:55:08' ), |
| 8 |
( '05:55:08' ), |
| 9 |
( '08:55:08' ), |
| 10 |
( '09:55:08' ), |
| 11 |
( '10:55:08' ) |
| 12 |
; |
| 13 |
CREATE INDEX idx_time ON test_time USING gin (i); |
| 14 |
SELECT * FROM test_time WHERE i<'08:55:08'::time ORDER BY i; |
| 15 |
i |
| 16 |
---------- |
| 17 |
03:55:08 |
| 18 |
04:55:08 |
| 19 |
05:55:08 |
| 20 |
(3 rows) |
| 21 |
|
| 22 |
SELECT * FROM test_time WHERE i<='08:55:08'::time ORDER BY i; |
| 23 |
i |
| 24 |
---------- |
| 25 |
03:55:08 |
| 26 |
04:55:08 |
| 27 |
05:55:08 |
| 28 |
08:55:08 |
| 29 |
(4 rows) |
| 30 |
|
| 31 |
SELECT * FROM test_time WHERE i='08:55:08'::time ORDER BY i; |
| 32 |
i |
| 33 |
---------- |
| 34 |
08:55:08 |
| 35 |
(1 row) |
| 36 |
|
| 37 |
SELECT * FROM test_time WHERE i>='08:55:08'::time ORDER BY i; |
| 38 |
i |
| 39 |
---------- |
| 40 |
08:55:08 |
| 41 |
09:55:08 |
| 42 |
10:55:08 |
| 43 |
(3 rows) |
| 44 |
|
| 45 |
SELECT * FROM test_time WHERE i>'08:55:08'::time ORDER BY i; |
| 46 |
i |
| 47 |
---------- |
| 48 |
09:55:08 |
| 49 |
10:55:08 |
| 50 |
(2 rows) |
| 51 |
|