Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf16978c

Browse files
committed
Merged new RUM state
2 parents7411ec2 +f06f900 commitf16978c

23 files changed

+596
-377
lines changed

‎contrib/mmts/arbiter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ static int MtmConnectSocket(int node, int port)
429429
snprintf(portstr,sizeof(portstr),"%d",port);
430430

431431
rc=pg_getaddrinfo_all(host,portstr,&hint,&addrs);
432-
if (rc!=0)
432+
if (rc!=0)
433433
{
434434
MTM_ELOG(LOG,"Arbiter failed to resolve host '%s' by name: %s",host,gai_strerror(rc));
435435
return-1;

‎contrib/rum/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ bin
1111
include
1212
lib
1313
pip-selfcheck.json
14-

‎contrib/rum/Makefile

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ REGRESS = rum rum_hash ruminv timestamp orderby orderby_hash altorder \
1919
macaddr inet cidr text varchar char bytea bit varbit\
2020
numeric
2121

22-
#EXTRA_CLEAN += rum--1.1.sql rum--1.0--1.1.sql
23-
2422
LDFLAGS_SL +=$(filter -lm,$(LIBS))
2523

2624
ifdefUSE_PGXS
@@ -37,15 +35,6 @@ endif
3735
wal-check: temp-install
3836
$(prove_check)
3937

40-
all: rum--1.1.sql
41-
42-
#9.6 requires 1.1 file but 10.0 could live with 1.0 + 1.0-1.1 files
43-
rum--1.1.sql: rum--1.0.sql rum--1.0--1.1.sql
44-
cat rum--1.0.sql rum--1.0--1.1.sql> rum--1.1.sql
45-
46-
rum--1.0--1.1.sql: Makefile gen_rum_sql--1.0--1.1.pl
47-
perl gen_rum_sql--1.0--1.1.pl> rum--1.0--1.1.sql
48-
4938
install: installincludes
5039

5140
installincludes:

‎contrib/rum/expected/orderby.out

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,3 +357,73 @@ SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER
357357
458 | Fri May 20 21:21:22.326724 2016
358358
(3 rows)
359359

360+
-- Test multicolumn index
361+
RESET enable_indexscan;
362+
RESET enable_indexonlyscan;
363+
RESET enable_bitmapscan;
364+
SET enable_seqscan = off;
365+
DROP INDEX tsts_idx;
366+
CREATE INDEX tsts_id_idx ON tsts USING rum (t rum_tsvector_addon_ops, id, d)
367+
WITH (attach = 'd', to = 't');
368+
EXPLAIN (costs off)
369+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND id = 1::int ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
370+
QUERY PLAN
371+
-----------------------------------------------------------------------------------
372+
Limit
373+
-> Index Scan using tsts_id_idx on tsts
374+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id = 1))
375+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
376+
(4 rows)
377+
378+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND id = 1::int ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
379+
id | d
380+
----+---
381+
(0 rows)
382+
383+
EXPLAIN (costs off)
384+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND id = 355::int ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
385+
QUERY PLAN
386+
-----------------------------------------------------------------------------------
387+
Limit
388+
-> Index Scan using tsts_id_idx on tsts
389+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id = 355))
390+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
391+
(4 rows)
392+
393+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND id = 355::int ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
394+
id | d
395+
-----+---------------------------------
396+
355 | Mon May 16 14:21:22.326724 2016
397+
(1 row)
398+
399+
EXPLAIN (costs off)
400+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d = '2016-05-11 11:21:22.326724'::timestamp ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
401+
QUERY PLAN
402+
----------------------------------------------------------------------------------------------------------------------------------
403+
Limit
404+
-> Index Scan using tsts_id_idx on tsts
405+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d = 'Wed May 11 11:21:22.326724 2016'::timestamp without time zone))
406+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
407+
(4 rows)
408+
409+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d = '2016-05-11 11:21:22.326724'::timestamp ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
410+
id | d
411+
-----+---------------------------------
412+
232 | Wed May 11 11:21:22.326724 2016
413+
(1 row)
414+
415+
EXPLAIN (costs off)
416+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d = '2000-05-01'::timestamp ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
417+
QUERY PLAN
418+
---------------------------------------------------------------------------------------------------------------------------
419+
Limit
420+
-> Index Scan using tsts_id_idx on tsts
421+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d = 'Mon May 01 00:00:00 2000'::timestamp without time zone))
422+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
423+
(4 rows)
424+
425+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d = '2000-05-01'::timestamp ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
426+
id | d
427+
----+---
428+
(0 rows)
429+

‎contrib/rum/expected/orderby_1.out

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,3 +325,73 @@ SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER
325325
458 | Fri May 20 21:21:22.326724 2016
326326
(3 rows)
327327

328+
-- Test multicolumn index
329+
RESET enable_indexscan;
330+
RESET enable_indexonlyscan;
331+
RESET enable_bitmapscan;
332+
SET enable_seqscan = off;
333+
DROP INDEX tsts_idx;
334+
CREATE INDEX tsts_id_idx ON tsts USING rum (t rum_tsvector_addon_ops, id, d)
335+
WITH (attach = 'd', to = 't');
336+
EXPLAIN (costs off)
337+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND id = 1::int ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
338+
QUERY PLAN
339+
-----------------------------------------------------------------------------------
340+
Limit
341+
-> Index Scan using tsts_id_idx on tsts
342+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id = 1))
343+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
344+
(4 rows)
345+
346+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND id = 1::int ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
347+
id | d
348+
----+---
349+
(0 rows)
350+
351+
EXPLAIN (costs off)
352+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND id = 355::int ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
353+
QUERY PLAN
354+
-----------------------------------------------------------------------------------
355+
Limit
356+
-> Index Scan using tsts_id_idx on tsts
357+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id = 355))
358+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
359+
(4 rows)
360+
361+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND id = 355::int ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
362+
id | d
363+
-----+---------------------------------
364+
355 | Mon May 16 14:21:22.326724 2016
365+
(1 row)
366+
367+
EXPLAIN (costs off)
368+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d = '2016-05-11 11:21:22.326724'::timestamp ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
369+
QUERY PLAN
370+
----------------------------------------------------------------------------------------------------------------------------------
371+
Limit
372+
-> Index Scan using tsts_id_idx on tsts
373+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d = 'Wed May 11 11:21:22.326724 2016'::timestamp without time zone))
374+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
375+
(4 rows)
376+
377+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d = '2016-05-11 11:21:22.326724'::timestamp ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
378+
id | d
379+
-----+---------------------------------
380+
232 | Wed May 11 11:21:22.326724 2016
381+
(1 row)
382+
383+
EXPLAIN (costs off)
384+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d = '2000-05-01'::timestamp ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
385+
QUERY PLAN
386+
---------------------------------------------------------------------------------------------------------------------------
387+
Limit
388+
-> Index Scan using tsts_id_idx on tsts
389+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d = 'Mon May 01 00:00:00 2000'::timestamp without time zone))
390+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
391+
(4 rows)
392+
393+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d = '2000-05-01'::timestamp ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
394+
id | d
395+
----+---
396+
(0 rows)
397+

‎contrib/rum/expected/orderby_hash.out

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,3 +357,73 @@ SELECT id, d FROM tstsh WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER
357357
458 | Fri May 20 21:21:22.326724 2016
358358
(3 rows)
359359

360+
-- Test multicolumn index
361+
RESET enable_indexscan;
362+
RESET enable_indexonlyscan;
363+
RESET enable_bitmapscan;
364+
SET enable_seqscan = off;
365+
DROP INDEX tstsh_idx;
366+
CREATE INDEX tstsh_id_idx ON tsts USING rum (t rum_tsvector_addon_ops, id, d)
367+
WITH (attach = 'd', to = 't');
368+
EXPLAIN (costs off)
369+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND id = 1::int ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
370+
QUERY PLAN
371+
-----------------------------------------------------------------------------------
372+
Limit
373+
-> Index Scan using tstsh_id_idx on tsts
374+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id = 1))
375+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
376+
(4 rows)
377+
378+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND id = 1::int ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
379+
id | d
380+
----+---
381+
(0 rows)
382+
383+
EXPLAIN (costs off)
384+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND id = 355::int ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
385+
QUERY PLAN
386+
-----------------------------------------------------------------------------------
387+
Limit
388+
-> Index Scan using tstsh_id_idx on tsts
389+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id = 355))
390+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
391+
(4 rows)
392+
393+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND id = 355::int ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
394+
id | d
395+
-----+---------------------------------
396+
355 | Mon May 16 14:21:22.326724 2016
397+
(1 row)
398+
399+
EXPLAIN (costs off)
400+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d = '2016-05-11 11:21:22.326724'::timestamp ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
401+
QUERY PLAN
402+
----------------------------------------------------------------------------------------------------------------------------------
403+
Limit
404+
-> Index Scan using tstsh_id_idx on tsts
405+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d = 'Wed May 11 11:21:22.326724 2016'::timestamp without time zone))
406+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
407+
(4 rows)
408+
409+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d = '2016-05-11 11:21:22.326724'::timestamp ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
410+
id | d
411+
-----+---------------------------------
412+
232 | Wed May 11 11:21:22.326724 2016
413+
(1 row)
414+
415+
EXPLAIN (costs off)
416+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d = '2000-05-01'::timestamp ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
417+
QUERY PLAN
418+
---------------------------------------------------------------------------------------------------------------------------
419+
Limit
420+
-> Index Scan using tstsh_id_idx on tsts
421+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d = 'Mon May 01 00:00:00 2000'::timestamp without time zone))
422+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
423+
(4 rows)
424+
425+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d = '2000-05-01'::timestamp ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
426+
id | d
427+
----+---
428+
(0 rows)
429+

‎contrib/rum/expected/orderby_hash_1.out

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,3 +325,73 @@ SELECT id, d FROM tstsh WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER
325325
458 | Fri May 20 21:21:22.326724 2016
326326
(3 rows)
327327

328+
-- Test multicolumn index
329+
RESET enable_indexscan;
330+
RESET enable_indexonlyscan;
331+
RESET enable_bitmapscan;
332+
SET enable_seqscan = off;
333+
DROP INDEX tstsh_idx;
334+
CREATE INDEX tstsh_id_idx ON tsts USING rum (t rum_tsvector_addon_ops, id, d)
335+
WITH (attach = 'd', to = 't');
336+
EXPLAIN (costs off)
337+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND id = 1::int ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
338+
QUERY PLAN
339+
-----------------------------------------------------------------------------------
340+
Limit
341+
-> Index Scan using tstsh_id_idx on tsts
342+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id = 1))
343+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
344+
(4 rows)
345+
346+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND id = 1::int ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
347+
id | d
348+
----+---
349+
(0 rows)
350+
351+
EXPLAIN (costs off)
352+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND id = 355::int ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
353+
QUERY PLAN
354+
-----------------------------------------------------------------------------------
355+
Limit
356+
-> Index Scan using tstsh_id_idx on tsts
357+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id = 355))
358+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
359+
(4 rows)
360+
361+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND id = 355::int ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
362+
id | d
363+
-----+---------------------------------
364+
355 | Mon May 16 14:21:22.326724 2016
365+
(1 row)
366+
367+
EXPLAIN (costs off)
368+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d = '2016-05-11 11:21:22.326724'::timestamp ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
369+
QUERY PLAN
370+
----------------------------------------------------------------------------------------------------------------------------------
371+
Limit
372+
-> Index Scan using tstsh_id_idx on tsts
373+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d = 'Wed May 11 11:21:22.326724 2016'::timestamp without time zone))
374+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
375+
(4 rows)
376+
377+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d = '2016-05-11 11:21:22.326724'::timestamp ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
378+
id | d
379+
-----+---------------------------------
380+
232 | Wed May 11 11:21:22.326724 2016
381+
(1 row)
382+
383+
EXPLAIN (costs off)
384+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d = '2000-05-01'::timestamp ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
385+
QUERY PLAN
386+
---------------------------------------------------------------------------------------------------------------------------
387+
Limit
388+
-> Index Scan using tstsh_id_idx on tsts
389+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d = 'Mon May 01 00:00:00 2000'::timestamp without time zone))
390+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
391+
(4 rows)
392+
393+
SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d = '2000-05-01'::timestamp ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
394+
id | d
395+
----+---
396+
(0 rows)
397+

‎contrib/rum/expected/rum.out

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,3 +350,15 @@ SELECT a <=> to_tsquery('pg_catalog.english', 'b:*'), *
350350
16.4493 | the few that escaped destruction in 1693. It is a beautiful, highly | '1693':7 'beauti':11 'destruct':5 'escap':4 'high':12
351351
(20 rows)
352352

353+
select 'bjarn:6237 stroustrup:6238'::tsvector <=> 'bjarn <-> stroustrup'::tsquery;
354+
?column?
355+
----------
356+
8.22467
357+
(1 row)
358+
359+
SELECT 'stroustrup:5508B,6233B,6238B bjarn:6235B,6237B' <=> 'bjarn <-> stroustrup'::tsquery;
360+
?column?
361+
----------
362+
2.05617
363+
(1 row)
364+

‎contrib/rum/gen_rum_sql--1.0--1.1.pl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@
6363
AS 'MODULE_PATHNAME'
6464
LANGUAGE C STRICT IMMUTABLE;
6565
66+
CREATE FUNCTION rum_TYPEIDENT_config(internal)
67+
RETURNS void
68+
AS 'MODULE_PATHNAME'
69+
LANGUAGE C IMMUTABLE STRICT;
70+
71+
6672
EOT
6773

6874
my$opclass_base_template=<<EOT;
@@ -103,6 +109,7 @@
103109
FUNCTION4rum_btree_consistent(internal,smallint,internal,int,internal,internal,internal,internal),
104110
FUNCTION5rum_TYPESUBIDENT_compare_prefix(TYPESUBNAME,TYPESUBNAME,int2, internal),
105111
-- support to TYPEIDENT distance in rum_tsvector_addon_ops
112+
FUNCTION6rum_TYPEIDENT_config(internal),
106113
FUNCTION9rum_TYPEIDENT_outer_distance(TYPENAME, TYPENAME, smallint),
107114
STORAGE TYPENAME;
108115

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp