pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: digoal@126.com
Subject: BUG #15173: why small gin_fuzzy_search_limit search more blocks than big gin_fuzzy_search_limit ?
Date: Wed, 25 Apr 2018 14:53:23 +0000
Message-ID: <152466800389.19805.11513995906384890285@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15173
Logged by:          Zhou Digoal
Email address:      digoal@126.com
PostgreSQL version: 10.3
Operating system:   CentOS 7.x x64
Description:        

postgres=# set gin_fuzzy_search_limit =10;
SET
Time: 0.188 ms
postgres=# explain (analyze,verbose,timing,costs,buffers) select count(*)
from tbl_lab where dict @> array[122562]::int8[] ;
                                                                QUERY PLAN  
                                                             
------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=1702903.64..1702903.65 rows=1 width=8) (actual
time=135.104..135.104 rows=1 loops=1)
   Output: count(*)
   Buffers: shared hit=145266
   ->  Bitmap Heap Scan on public.tbl_lab  (cost=3868.90..1701675.35
rows=491316 width=0) (actual time=135.044..135.082 rows=78 loops=1)
         Recheck Cond: (tbl_lab.dict @> '{122562}'::bigint[])
         Heap Blocks: exact=78
         Buffers: shared hit=145266
         ->  Bitmap Index Scan on idx_tbl_lab_dict  (cost=0.00..3746.07
rows=491316 width=0) (actual time=96.252..96.252 rows=78 loops=1)
               Index Cond: (tbl_lab.dict @> '{122562}'::bigint[])
               Buffers: shared hit=145248
 Planning Time: 0.190 ms
 JIT:
   Functions: 5
   Generation Time: 1.091 ms
   Inlining: true
   Inlining Time: 5.746 ms
   Optimization: true
   Optimization Time: 22.590 ms
   Emission Time: 10.321 ms
 Execution Time: 136.271 ms
(20 rows)

Time: 136.887 ms
postgres=# set gin_fuzzy_search_limit =5000;
SET
Time: 0.222 ms
postgres=# explain (analyze,verbose,timing,costs,buffers) select count(*)
from tbl_lab where dict @> array[122562]::int8[] ;
                                                                QUERY PLAN  
                                                             
------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=1702903.64..1702903.65 rows=1 width=8) (actual
time=48.953..48.953 rows=1 loops=1)
   Output: count(*)
   Buffers: shared hit=187
   ->  Bitmap Heap Scan on public.tbl_lab  (cost=3868.90..1701675.35
rows=491316 width=0) (actual time=45.491..48.031 rows=9290 loops=1)
         Recheck Cond: (tbl_lab.dict @> '{122562}'::bigint[])
         Heap Blocks: exact=9223
         Buffers: shared hit=187
         ->  Bitmap Index Scan on idx_tbl_lab_dict  (cost=0.00..3746.07
rows=491316 width=0) (actual time=5.027..5.027 rows=9290 loops=1)
               Index Cond: (tbl_lab.dict @> '{122562}'::bigint[])
               Buffers: shared hit=166
 Planning Time: 0.165 ms
 JIT:
   Functions: 5
   Generation Time: 1.154 ms
   Inlining: true
   Inlining Time: 6.152 ms
   Optimization: true
   Optimization Time: 22.501 ms
   Emission Time: 10.273 ms
 Execution Time: 50.183 ms
(20 rows)

Time: 50.771 ms



view thread (3+ messages)  latest in thread

Message-ID: <152466800389.19805.11513995906384890285@wrigleys.postgresql.org>
Permalink:  ../152466800389.19805.11513995906384890285@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/152466800389.19805.11513995906384890285@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, digoal@126.com
  Subject: Re: BUG #15173: why small gin_fuzzy_search_limit search more blocks than big gin_fuzzy_search_limit ?
  In-Reply-To: <152466800389.19805.11513995906384890285@wrigleys.postgresql.org>
  References: <152466800389.19805.11513995906384890285@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox