~ubuntu-branches/debian/experimental/postgresql-11/experimental

« back to all changes in this revision

Viewing changes to contrib/btree_gist/expected/inet.out

  • Committer: Package Import Robot
  • Author(s): Christoph Berg
  • Date: 2018-05-22 14:19:08 UTC
  • Revision ID: package-import@ubuntu.com-20180522141908-0oy9ujs1b5vrda74
Tags: upstream-11~beta1
ImportĀ upstreamĀ versionĀ 11~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- inet check
 
2
CREATE TABLE inettmp (a inet);
 
3
\copy inettmp from 'data/inet.data'
 
4
SET enable_seqscan=on;
 
5
SELECT count(*) FROM inettmp WHERE a <  '89.225.196.191';
 
6
 count 
 
7
-------
 
8
   213
 
9
(1 row)
 
10
 
 
11
SELECT count(*) FROM inettmp WHERE a <= '89.225.196.191';
 
12
 count 
 
13
-------
 
14
   214
 
15
(1 row)
 
16
 
 
17
SELECT count(*) FROM inettmp WHERE a  = '89.225.196.191';
 
18
 count 
 
19
-------
 
20
     1
 
21
(1 row)
 
22
 
 
23
SELECT count(*) FROM inettmp WHERE a >= '89.225.196.191';
 
24
 count 
 
25
-------
 
26
   387
 
27
(1 row)
 
28
 
 
29
SELECT count(*) FROM inettmp WHERE a >  '89.225.196.191';
 
30
 count 
 
31
-------
 
32
   386
 
33
(1 row)
 
34
 
 
35
CREATE INDEX inetidx ON inettmp USING gist ( a );
 
36
SET enable_seqscan=off;
 
37
SELECT count(*) FROM inettmp WHERE a <  '89.225.196.191'::inet;
 
38
 count 
 
39
-------
 
40
   213
 
41
(1 row)
 
42
 
 
43
SELECT count(*) FROM inettmp WHERE a <= '89.225.196.191'::inet;
 
44
 count 
 
45
-------
 
46
   214
 
47
(1 row)
 
48
 
 
49
SELECT count(*) FROM inettmp WHERE a  = '89.225.196.191'::inet;
 
50
 count 
 
51
-------
 
52
     1
 
53
(1 row)
 
54
 
 
55
SELECT count(*) FROM inettmp WHERE a >= '89.225.196.191'::inet;
 
56
 count 
 
57
-------
 
58
   387
 
59
(1 row)
 
60
 
 
61
SELECT count(*) FROM inettmp WHERE a >  '89.225.196.191'::inet;
 
62
 count 
 
63
-------
 
64
   386
 
65
(1 row)
 
66
 
 
67
VACUUM inettmp;
 
68
-- gist_inet_ops lacks a fetch function, so this should not be index-only scan
 
69
EXPLAIN (COSTS OFF)
 
70
SELECT count(*) FROM inettmp WHERE a  = '89.225.196.191'::inet;
 
71
                       QUERY PLAN                       
 
72
--------------------------------------------------------
 
73
 Aggregate
 
74
   ->  Bitmap Heap Scan on inettmp
 
75
         Recheck Cond: (a = '89.225.196.191'::inet)
 
76
         ->  Bitmap Index Scan on inetidx
 
77
               Index Cond: (a = '89.225.196.191'::inet)
 
78
(5 rows)
 
79
 
 
80
SELECT count(*) FROM inettmp WHERE a  = '89.225.196.191'::inet;
 
81
 count 
 
82
-------
 
83
     1
 
84
(1 row)
 
85
 
 
86
DROP INDEX inetidx;
 
87
CREATE INDEX ON inettmp USING gist (a gist_inet_ops, a inet_ops);
 
88
-- likewise here (checks for core planner bug)
 
89
EXPLAIN (COSTS OFF)
 
90
SELECT count(*) FROM inettmp WHERE a  = '89.225.196.191'::inet;
 
91
                       QUERY PLAN                       
 
92
--------------------------------------------------------
 
93
 Aggregate
 
94
   ->  Bitmap Heap Scan on inettmp
 
95
         Recheck Cond: (a = '89.225.196.191'::inet)
 
96
         ->  Bitmap Index Scan on inettmp_a_a1_idx
 
97
               Index Cond: (a = '89.225.196.191'::inet)
 
98
(5 rows)
 
99
 
 
100
SELECT count(*) FROM inettmp WHERE a  = '89.225.196.191'::inet;
 
101
 count 
 
102
-------
 
103
     1
 
104
(1 row)
 
105