postgresql/pg_jsonb_delete_op
6 years agoMerge pull request #2 from schinckel/patch-2 master
Glyn Astill [Sat, 24 Jan 2015 08:10:56 +0000 (08:10 +0000)]
Merge pull request #2 from schinckel/patch-2

Use array ALL() function, and remove json/jsonb casts

6 years agoMerge pull request #1 from schinckel/patch-1
Glyn Astill [Sat, 24 Jan 2015 08:08:42 +0000 (08:08 +0000)]
Merge pull request #1 from schinckel/patch-1

Remove two unnecessary operations.

6 years agoUse array ALL() function, and remove json/jsonb casts
Matthew Schinckel [Fri, 23 Jan 2015 09:06:54 +0000 (19:36 +1030)]
Use array ALL() function, and remove json/jsonb casts

<pre>
[[local]:5432] matt@~ =# EXPLAIN ANALYZE SELECT to_json('x2'::text)::jsonb ?| ARRAY['x', 'y'] FROM generate_series(1,100000);
                                                        QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------
 Function Scan on generate_series  (cost=0.00..20.00 rows=1000 width=0) (actual time=23.261..357.720 rows=100000 loops=1)
 Planning time: 0.051 ms
 Execution time: 376.334 ms
(3 rows)

Time: 376.732 ms

[[local]:5432] matt@~ =# EXPLAIN ANALYZE SELECT 'x2' <> ALL( ARRAY['x', 'y']) FROM generate_series(1,100000);
                                                       QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------
 Function Scan on generate_series  (cost=0.00..12.50 rows=1000 width=0) (actual time=22.687..59.327 rows=100000 loops=1)
 Planning time: 0.112 ms
 Execution time: 71.561 ms
(3 rows)

Time: 72.162 ms
</pre>

6 years agoRemove two unnecessary operations.
Matthew Schinckel [Fri, 23 Jan 2015 09:02:19 +0000 (19:32 +1030)]
Remove two unnecessary operations.

<pre>
[[local]:5432] matt@~ =# EXPLAIN ANALYZE SELECT 'x' <> 'x' FROM generate_series(1,100000);
                                                       QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------
 Function Scan on generate_series  (cost=0.00..10.00 rows=1000 width=0) (actual time=22.346..45.794 rows=100000 loops=1)
 Planning time: 0.042 ms
 Execution time: 59.130 ms
(3 rows)

Time: 59.744 ms
[[local]:5432] matt@~ =# EXPLAIN ANALYZE SELECT 'x' <> 'y' FROM generate_series(1,100000);
                                                       QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------
 Function Scan on generate_series  (cost=0.00..10.00 rows=1000 width=0) (actual time=21.784..45.676 rows=100000 loops=1)
 Planning time: 0.043 ms
 Execution time: 59.294 ms
(3 rows)

Time: 59.663 ms
</pre>

6 years agoRemove error in example
glyn [Mon, 19 Jan 2015 09:50:16 +0000 (09:50 +0000)]
Remove error in example

6 years agoInfact there is no need to roll up values in where clause when deleteing by key
glyn [Mon, 19 Jan 2015 09:41:44 +0000 (09:41 +0000)]
Infact there is no need to roll up values in where clause when deleteing by key

6 years agoUse to_json rather than blindly quoting strings in where clause
glyn [Mon, 19 Jan 2015 09:19:58 +0000 (09:19 +0000)]
Use to_json rather than blindly quoting strings in where clause

6 years agoRevert "Use to_json rather than concatenating strings in where clause"
glyn [Mon, 19 Jan 2015 09:00:21 +0000 (09:00 +0000)]
Revert "Use to_json rather than concatenating strings in where clause"

This reverts commit 263aa2ca57f58c294adb05ba51649dd7c6edc14f.

6 years agoUse to_json rather than concatenating strings in where clause
glyn [Mon, 19 Jan 2015 08:49:25 +0000 (08:49 +0000)]
Use to_json rather than concatenating strings in where clause

6 years agoAmmend incorrect comment defs
glyn [Fri, 16 Jan 2015 16:26:57 +0000 (16:26 +0000)]
Ammend incorrect comment defs

6 years agoInitial commit
glyn [Fri, 16 Jan 2015 16:18:10 +0000 (16:18 +0000)]
Initial commit

6 years agoInitial commit
glyn [Fri, 16 Jan 2015 16:16:10 +0000 (16:16 +0000)]
Initial commit