@@ -2172,6 +2172,22 @@ SELECT gin_debug_query_path_value('$ = true');
2172
2172
2173
2173
(1 row)
2174
2174
2175
+ SELECT gin_debug_query_path_value('$ . ? (review_votes > 10) . review_rating < 7');
2176
+ gin_debug_query_path_value
2177
+ --------------------------------
2178
+ AND +
2179
+ review_rating < 7 , entry 0 +
2180
+ review_votes > 10 , entry 1 +
2181
+
2182
+ (1 row)
2183
+
2184
+ SELECT gin_debug_query_path_value('similar_product_ids . ? (# = "B0002W4TL2") . $');
2185
+ gin_debug_query_path_value
2186
+ -------------------------------------------------
2187
+ similar_product_ids.# = "B0002W4TL2" , entry 0 +
2188
+
2189
+ (1 row)
2190
+
2175
2191
SELECT gin_debug_query_value_path('NOT NOT NOT x(y(NOT (a=1) and NOT (b=2)) OR NOT NOT (c=3)) and z = 5');
2176
2192
gin_debug_query_value_path
2177
2193
----------------------------
@@ -2376,19 +2392,35 @@ SELECT gin_debug_query_value_path('*.@# ($ = 4 or $ = 2)');
2376
2392
(1 row)
2377
2393
2378
2394
SELECT gin_debug_query_value_path('tags.#.term. ? ( # = "NYC").x > 0');
2379
- gin_debug_query_value_path
2380
- ------------------------------
2381
- tags.#.term.x > 0 , entry 0 +
2395
+ gin_debug_query_value_path
2396
+ ----------------------------------
2397
+ tags.#.term.# = "NYC" , entry 0 +
2382
2398
2383
2399
(1 row)
2384
2400
2385
- SELECT gin_debug_query_path_value ('$ = true');
2386
- gin_debug_query_path_value
2401
+ SELECT gin_debug_query_value_path ('$ = true');
2402
+ gin_debug_query_value_path
2387
2403
----------------------------
2388
2404
$ = true , entry 0 +
2389
2405
2390
2406
(1 row)
2391
2407
2408
+ SELECT gin_debug_query_value_path('$ . ? (review_votes > 10) . review_rating < 7');
2409
+ gin_debug_query_value_path
2410
+ --------------------------------
2411
+ AND +
2412
+ review_rating < 7 , entry 0 +
2413
+ review_votes > 10 , entry 1 +
2414
+
2415
+ (1 row)
2416
+
2417
+ SELECT gin_debug_query_value_path('similar_product_ids . ? (# = "B0002W4TL2") . $');
2418
+ gin_debug_query_value_path
2419
+ -------------------------------------------------
2420
+ similar_product_ids.# = "B0002W4TL2" , entry 0 +
2421
+
2422
+ (1 row)
2423
+
2392
2424
---table and index
2393
2425
select count(*) from test_jsquery where (v->>'review_helpful_votes')::int4 > 0;
2394
2426
count
@@ -2656,6 +2688,18 @@ select count(*) from test_jsquery where v @@ 'similar_product_ids.#';
2656
2688
1001
2657
2689
(1 row)
2658
2690
2691
+ select count(*) from test_jsquery where v @@ '$ . ? (review_votes > 10) . review_rating < 7';
2692
+ count
2693
+ -------
2694
+ 79
2695
+ (1 row)
2696
+
2697
+ select count(*) from test_jsquery where v @@ 'similar_product_ids . ? (# = "B0002W4TL2") . $';
2698
+ count
2699
+ -------
2700
+ 3
2701
+ (1 row)
2702
+
2659
2703
select v from test_jsquery where v @@ 'array <@ [2,3]' order by v;
2660
2704
v
2661
2705
-------------------
@@ -2922,6 +2966,18 @@ select count(*) from test_jsquery where v @@ 'similar_product_ids.#';
2922
2966
1001
2923
2967
(1 row)
2924
2968
2969
+ select count(*) from test_jsquery where v @@ '$ . ? (review_votes > 10) . review_rating < 7';
2970
+ count
2971
+ -------
2972
+ 79
2973
+ (1 row)
2974
+
2975
+ select count(*) from test_jsquery where v @@ 'similar_product_ids . ? (# = "B0002W4TL2") . $';
2976
+ count
2977
+ -------
2978
+ 3
2979
+ (1 row)
2980
+
2925
2981
explain (costs off) select v from test_jsquery where v @@ 'array <@ [2,3]' order by v;
2926
2982
QUERY PLAN
2927
2983
---------------------------------------------------------------
@@ -3233,6 +3289,18 @@ select count(*) from test_jsquery where v @@ 'similar_product_ids.#';
3233
3289
950
3234
3290
(1 row)
3235
3291
3292
+ select count(*) from test_jsquery where v @@ '$ . ? (review_votes > 10) . review_rating < 7';
3293
+ count
3294
+ -------
3295
+ 79
3296
+ (1 row)
3297
+
3298
+ select count(*) from test_jsquery where v @@ 'similar_product_ids . ? (# = "B0002W4TL2") . $';
3299
+ count
3300
+ -------
3301
+ 3
3302
+ (1 row)
3303
+
3236
3304
explain (costs off) select v from test_jsquery where v @@ 'array <@ [2,3]' order by v;
3237
3305
QUERY PLAN
3238
3306
---------------------------------------------------------------
0 commit comments