~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to contrib/btree_gist/sql/float4.sql

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- float4 check
 
2
 
 
3
CREATE TABLE float4tmp (a float4);
 
4
 
 
5
\copy float4tmp from 'data/float4.data'
 
6
 
 
7
SET enable_seqscan=on;
 
8
 
 
9
SELECT count(*) FROM float4tmp WHERE a <  -179.0;
 
10
 
 
11
SELECT count(*) FROM float4tmp WHERE a <= -179.0;
 
12
 
 
13
SELECT count(*) FROM float4tmp WHERE a  = -179.0;
 
14
 
 
15
SELECT count(*) FROM float4tmp WHERE a >= -179.0;
 
16
 
 
17
SELECT count(*) FROM float4tmp WHERE a >  -179.0;
 
18
 
 
19
SELECT a, a <-> '-179.0' FROM float4tmp ORDER BY a <-> '-179.0' LIMIT 3;
 
20
 
 
21
CREATE INDEX float4idx ON float4tmp USING gist ( a );
 
22
 
 
23
SET enable_seqscan=off;
 
24
 
 
25
SELECT count(*) FROM float4tmp WHERE a <  -179.0::float4;
 
26
 
 
27
SELECT count(*) FROM float4tmp WHERE a <= -179.0::float4;
 
28
 
 
29
SELECT count(*) FROM float4tmp WHERE a  = -179.0::float4;
 
30
 
 
31
SELECT count(*) FROM float4tmp WHERE a >= -179.0::float4;
 
32
 
 
33
SELECT count(*) FROM float4tmp WHERE a >  -179.0::float4;
 
34
 
 
35
EXPLAIN (COSTS OFF)
 
36
SELECT a, a <-> '-179.0' FROM float4tmp ORDER BY a <-> '-179.0' LIMIT 3;
 
37
SELECT a, a <-> '-179.0' FROM float4tmp ORDER BY a <-> '-179.0' LIMIT 3;