Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aIM4V-0001QS-6d for pgsql-admin@arkaria.postgresql.org; Sun, 10 Jan 2016 19:54:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aIM4T-0000vO-EN for pgsql-admin@arkaria.postgresql.org; Sun, 10 Jan 2016 19:54:37 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aIM2C-0007N4-G6 for pgsql-admin@postgresql.org; Sun, 10 Jan 2016 19:52:17 +0000 Received: from snt004-omc1s42.hotmail.com ([65.54.61.79]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aIM28-00069m-OC for pgsql-admin@postgresql.org; Sun, 10 Jan 2016 19:52:15 +0000 Received: from SNT147-W70 ([65.55.90.7]) by SNT004-OMC1S42.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Sun, 10 Jan 2016 11:52:12 -0800 X-TMN: [BX3XgT5tZSQvLw5S4sBHDRG2uI8h4tuc] X-Originating-Email: [smerlo50@outlook.com] Message-ID: Content-Type: multipart/alternative; boundary="_6dffb1a4-abcd-451d-847a-49219f628988_" From: Saulo Merlo To: "pgsql-admin@postgresql.org" Subject: Large Binary Columns - Slow Query Date: Sun, 10 Jan 2016 19:52:12 +0000 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 10 Jan 2016 19:52:12.0257 (UTC) FILETIME=[65C43510:01D14BE0] X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org --_6dffb1a4-abcd-451d-847a-49219f628988_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable The binary columns are large so I think that's why the query referencing th= em is slow.PostgreSQL 9.2Is there a way to speed it up=2C maybe compression= on transfer? Some indexes has millions of rows...Maybe create an index to = some specifics situations=2C and not general ones. Thank you. QUERY:SELECT ni.segment_index AS note_id=2C=0A= f.inode_id AS file_id=2C=0A= f.node_full_path AS filename=2C=0A= f.last_changed AS date_created=2C=0A= f.file_data AS main_binary=2C=0A= medium.inode_id AS medium_id=2C=0A= medium.file_data AS medium_binary=2C=0A= thumbnail.inode_id AS thumbnail_id=2C=0A= thumbnail.file_data AS thumbnail_binary=0A= FROM gorfs.nodes AS f=0A= INNER JOIN gorfs.inode_segments AS fd ON fd.st_ino_target =3D f.inode_id=0A= INNER JOIN gorfs.inode_segments AS mv ON mv.st_ino_target =3D fd.st_ino=0A= AND mv.segment_index =3D 'main.with_name'=0A= INNER JOIN gorfs.inode_segments AS fi ON fi.st_ino_target =3D mv.st_ino=0A= INNER JOIN gorfs.inode_segments AS fn ON fn.st_ino_target =3D fi.st_ino=0A= INNER JOIN gorfs.inode_segments AS ni ON ni.st_ino_target =3D fn.st_ino=0A= LEFT JOIN=0A= (SELECT f.inode_id=2C=0A= f.file_data=2C=0A= fi.st_ino=0A= FROM gorfs.nodes AS f=0A= INNER JOIN gorfs.inode_segments AS fd ON fd.st_ino_target =3D f.inode_id= =0A= INNER JOIN gorfs.inode_segments AS mv ON mv.st_ino_target =3D fd.st_ino= =0A= AND mv.segment_index =3D 'medium.with_name'=0A= INNER JOIN gorfs.inode_segments AS fi ON fi.st_ino_target =3D mv.st_ino = ) AS medium ON medium.st_ino =3D fn.st_ino_target=0A= LEFT JOIN=0A= (SELECT f.inode_id=2C=0A= f.file_data=2C=0A= fi.st_ino=0A= FROM gorfs.nodes AS f=0A= INNER JOIN gorfs.inode_segments AS fd ON fd.st_ino_target =3D f.inode_id= =0A= INNER JOIN gorfs.inode_segments AS mv ON mv.st_ino_target =3D fd.st_ino= =0A= AND mv.segment_index =3D 'thumbnail.with_name'=0A= INNER JOIN gorfs.inode_segments AS fi ON fi.st_ino_target =3D mv.st_ino = ) AS thumbnail ON thumbnail.st_ino =3D fn.st_ino_target=0A= WHERE f.file_data IS NOT NULL LIMIT 500=3BEXPLAIN ANALYZE:"Limit (cost=3D2= 0243.45..1593866.18 rows=3D500 width=3D180) (actual time=3D210.036..44701.4= 06 rows=3D500 loops=3D1)"=0A= " -> Nested Loop Left Join (cost=3D20243.45..757747912.38 rows=3D240759 = width=3D180) (actual time=3D210.036..44701.223 rows=3D500 loops=3D1)"=0A= " -> Nested Loop Left Join (cost=3D19724.45..450144827.58 rows=3D2= 40759 width=3D148) (actual time=3D196.881..44353.113 rows=3D490 loops=3D1)"= =0A= " -> Nested Loop (cost=3D19205.46..168833316.21 rows=3D24075= 9 width=3D108) (actual time=3D196.239..43707.952 rows=3D486 loops=3D1)"=0A= " -> Nested Loop (cost=3D19205.46..164947484.34 rows= =3D354030 width=3D107) (actual time=3D196.233..43706.095 rows=3D486 loops= =3D1)"=0A= " -> Nested Loop (cost=3D19205.46..159233457.64 = rows=3D520593 width=3D99) (actual time=3D196.223..43704.141 rows=3D486 loop= s=3D1)"=0A= " -> Nested Loop (cost=3D19205.46..1530560= 28.27 rows=3D987163 width=3D107) (actual time=3D196.202..43700.535 rows=3D4= 86 loops=3D1)"=0A= " Join Filter: ((("t"."st_ino")::bigin= t =3D ("p"."st_ino_target")::bigint) AND (CASE WHEN ("f"."constant_name" = =3D 'S_IFREG'::"gorfs"."mode_t_constant_name") THEN (SubPlan 4) ELSE NULL::= "bytea" END IS NOT NULL))"=0A= " -> Nested Loop (cost=3D19205.46..8= 3831623.03 rows=3D1458893 width=3D36) (actual time=3D155.629..43307.564 row= s=3D486 loops=3D1)"=0A= " Join Filter: ((B'0000000000000= 0001111000000000000'::"bit" & ("t"."st_mode")::"bit") =3D ("f"."bits")::"bi= t")"=0A= " Rows Removed by Join Filter: 1= 0673"=0A= " -> Nested Loop (cost=3D18686= .46..83243898.69 rows=3D1458893 width=3D41) (actual time=3D155.432..43302.7= 68 rows=3D486 loops=3D1)"=0A= " -> Nested Loop (cost= =3D18686.46..59543972.56 rows=3D2145267 width=3D41) (actual time=3D155.420.= .43300.521 rows=3D486 loops=3D1)"=0A= " -> Merge Join (c= ost=3D18686.46..29848042.37 rows=3D4751151 width=3D16) (actual time=3D155.3= 97..43289.955 rows=3D486 loops=3D1)"=0A= " Merge Cond: = (("fd"."st_ino")::bigint =3D ("mv"."st_ino_target")::bigint)"=0A= " -> Index Sc= an using "ix_inode_segments_st_inos" on "inode_segments" "fd" (cost=3D0.00= ..24356396.96 rows=3D83232691 width=3D16) (actual time=3D0.080..43016.366 r= ows=3D2037019 loops=3D1)"=0A= " -> Index Sc= an using "ix_inode_segments_climb_tree" on "inode_segments" "mv" (cost=3D0= .00..7695601.08 rows=3D6986452 width=3D16) (actual time=3D0.197..96.693 row= s=3D487 loops=3D1)"=0A= " Index = Cond: (("segment_index")::"text" =3D 'main.with_name'::"text")"=0A= " -> Index Scan usi= ng "pk_inodes" on "inodes" "t" (cost=3D0.00..6.24 rows=3D1 width=3D29) (ac= tual time=3D0.020..0.020 rows=3D1 loops=3D486)"=0A= " Index Cond: = (("st_ino")::bigint =3D ("fd"."st_ino_target")::bigint)"=0A= " -> Index Scan using "ix= _inode_segments_st_ino_targets" on "inode_segments" "fi" (cost=3D0.00..11.= 04 rows=3D1 width=3D16) (actual time=3D0.003..0.004 rows=3D1 loops=3D486)"= =0A= " Index Cond: (("st_= ino_target")::bigint =3D ("mv"."st_ino")::bigint)"=0A= " -> Materialize (cost=3D519.0= 0..519.97 rows=3D23 width=3D36) (actual time=3D0.001..0.003 rows=3D23 loops= =3D486)"=0A= " -> Subquery Scan on "f"= (cost=3D519.00..519.86 rows=3D23 width=3D36) (actual time=3D0.138..0.452 = rows=3D23 loops=3D1)"=0A= " -> CTE Scan on "s= tat_h_with_bits" "sb" (cost=3D519.00..519.63 rows=3D23 width=3D72) (actual= time=3D0.137..0.447 rows=3D23 loops=3D1)"=0A= " CTE stat_h"= =0A= " -> Values= Scan on "*VALUES*" (cost=3D0.00..0.29 rows=3D23 width=3D68) (actual time= =3D0.007..0.030 rows=3D23 loops=3D1)"=0A= " CTE stat_h_w= ith_bits"=0A= " -> CTE Sc= an on "stat_h" "s" (cost=3D0.00..518.71 rows=3D23 width=3D68) (actual time= =3D0.120..0.407 rows=3D23 loops=3D1)"=0A= " SubP= lan 6"=0A= " ->= Aggregate (cost=3D22.51..22.52 rows=3D1 width=3D32) (actual time=3D0.013= ..0.013 rows=3D1 loops=3D23)"=0A= " = -> Function Scan on "regexp_split_to_table" "digits" (cost=3D0.01..10= .01 rows=3D1000 width=3D32) (actual time=3D0.008..0.009 rows=3D3 loops=3D23= )"=0A= " -> Index Scan using "ix_inode_segme= nts_st_ino_targets" on "inode_segments" "p" (cost=3D0.00..10.97 rows=3D1 w= idth=3D79) (actual time=3D0.002..0.002 rows=3D1 loops=3D486)"=0A= " Index Cond: (("st_ino_target")= ::bigint =3D ("fd"."st_ino_target")::bigint)"=0A= " SubPlan 4"=0A= " -> Aggregate (cost=3D36.46..36.4= 7 rows=3D1 width=3D47) (actual time=3D0.712..0.712 rows=3D1 loops=3D486)"= =0A= " -> Index Scan using "ix_ino= de_segments_st_inos" on "inode_segments" "fs" (cost=3D0.00..36.33 rows=3D5= 2 width=3D47) (actual time=3D0.003..0.004 rows=3D1 loops=3D486)"=0A= " Index Cond: (("st_ino"= )::bigint =3D ("p"."st_ino_target")::bigint)"=0A= " -> Index Scan using "pk_inodes" on "inode= s" "i" (cost=3D0.00..6.25 rows=3D1 width=3D8) (actual time=3D0.006..0.006 = rows=3D1 loops=3D486)"=0A= " Index Cond: (("st_ino")::bigint =3D = ("p"."st_ino")::bigint)"=0A= " Filter: ((("st_ino")::bigint =3D 2) = OR ((B'00000000000000001111000000000000'::"bit" & ("st_mode")::"bit") =3D B= '00000000000000000100000000000000'::"bit"))"=0A= " -> Index Scan using "ix_inode_segments_st_ino_t= argets" on "inode_segments" "fn" (cost=3D0.00..10.97 rows=3D1 width=3D16) = (actual time=3D0.003..0.003 rows=3D1 loops=3D486)"=0A= " Index Cond: (("st_ino_target")::bigint =3D= ("fi"."st_ino")::bigint)"=0A= " -> Index Scan using "ix_inode_segments_st_ino_targets= " on "inode_segments" "ni" (cost=3D0.00..10.97 rows=3D1 width=3D17) (actua= l time=3D0.003..0.003 rows=3D1 loops=3D486)"=0A= " Index Cond: (("st_ino_target")::bigint =3D ("fn"= ."st_ino")::bigint)"=0A= " -> Nested Loop (cost=3D519.00..1168.43 rows=3D1 width=3D48= ) (actual time=3D1.296..1.326 rows=3D1 loops=3D486)"=0A= " Join Filter: ((B'00000000000000001111000000000000'::"b= it" & ("t"."st_mode")::"bit") =3D ("sb"."bits")::"bit")"=0A= " Rows Removed by Join Filter: 16"=0A= " -> Nested Loop (cost=3D0.00..648.22 rows=3D1 width= =3D33) (actual time=3D1.079..1.080 rows=3D1 loops=3D486)"=0A= " -> Nested Loop (cost=3D0.00..641.97 rows=3D1 w= idth=3D24) (actual time=3D1.076..1.077 rows=3D1 loops=3D486)"=0A= " -> Nested Loop (cost=3D0.00..635.72 rows= =3D1 width=3D32) (actual time=3D1.026..1.027 rows=3D1 loops=3D486)"=0A= " -> Nested Loop (cost=3D0.00..624.7= 4 rows=3D1 width=3D16) (actual time=3D0.981..0.982 rows=3D1 loops=3D486)"= =0A= " -> Nested Loop (cost=3D0.00.= .602.15 rows=3D1 width=3D16) (actual time=3D0.964..0.965 rows=3D1 loops=3D4= 86)"=0A= " -> Index Scan using "ix= _inode_segments_st_inos" on "inode_segments" "fi" (cost=3D0.00..21.51 rows= =3D52 width=3D16) (actual time=3D0.003..0.003 rows=3D1 loops=3D486)"=0A= " Index Cond: (("st_= ino")::bigint =3D ("fn"."st_ino_target")::bigint)"=0A= " -> Index Scan using "pk= _inode_segments" on "inode_segments" "mv" (cost=3D0.00..11.16 rows=3D1 wid= th=3D16) (actual time=3D0.947..0.947 rows=3D1 loops=3D493)"=0A= " Index Cond: ((("st= _ino")::bigint =3D ("fi"."st_ino_target")::bigint) AND (("segment_index")::= "text" =3D 'medium.with_name'::"text"))"=0A= " -> Index Scan using "ix_inode= _segments_st_inos" on "inode_segments" "fd" (cost=3D0.00..22.07 rows=3D52 = width=3D16) (actual time=3D0.023..0.023 rows=3D1 loops=3D345)"=0A= " Index Cond: (("st_ino"):= :bigint =3D ("mv"."st_ino_target")::bigint)"=0A= " -> Index Scan using "ix_inode_segme= nts_st_ino_targets" on "inode_segments" "p" (cost=3D0.00..10.97 rows=3D1 w= idth=3D16) (actual time=3D0.062..0.062 rows=3D1 loops=3D345)"=0A= " Index Cond: (("st_ino_target")= ::bigint =3D ("fd"."st_ino_target")::bigint)"=0A= " -> Index Scan using "pk_inodes" on "inode= s" "i" (cost=3D0.00..6.25 rows=3D1 width=3D8) (actual time=3D0.069..0.069 = rows=3D1 loops=3D345)"=0A= " Index Cond: (("st_ino")::bigint =3D = ("p"."st_ino")::bigint)"=0A= " Filter: ((("st_ino")::bigint =3D 2) = OR ((B'00000000000000001111000000000000'::"bit" & ("st_mode")::"bit") =3D B= '00000000000000000100000000000000'::"bit"))"=0A= " -> Index Scan using "pk_inodes" on "inodes" "t"= (cost=3D0.00..6.24 rows=3D1 width=3D21) (actual time=3D0.003..0.003 rows= =3D1 loops=3D345)"=0A= " Index Cond: (("st_ino")::bigint =3D ("p"."= st_ino_target")::bigint)"=0A= " -> CTE Scan on "stat_h_with_bits" "sb" (cost=3D519.0= 0..519.63 rows=3D23 width=3D72) (actual time=3D0.002..0.010 rows=3D23 loops= =3D345)"=0A= " CTE stat_h"=0A= " -> Values Scan on "*VALUES*" (cost=3D0.00..0= .29 rows=3D23 width=3D68) (actual time=3D0.003..0.025 rows=3D23 loops=3D1)"= =0A= " CTE stat_h_with_bits"=0A= " -> CTE Scan on "stat_h" "s" (cost=3D0.00..51= 8.71 rows=3D23 width=3D68) (actual time=3D0.101..0.419 rows=3D23 loops=3D1)= "=0A= " SubPlan 9"=0A= " -> Aggregate (cost=3D22.51..22.52 ro= ws=3D1 width=3D32) (actual time=3D0.012..0.012 rows=3D1 loops=3D23)"=0A= " -> Function Scan on "regexp_spl= it_to_table" "digits" (cost=3D0.01..10.01 rows=3D1000 width=3D32) (actual = time=3D0.008..0.008 rows=3D3 loops=3D23)"=0A= " SubPlan 2"=0A= " -> Aggregate (cost=3D36.46..36.47 rows=3D1 width= =3D47) (actual time=3D0.314..0.314 rows=3D1 loops=3D345)"=0A= " -> Index Scan using "ix_inode_segments_st_ino= s" on "inode_segments" "fs" (cost=3D0.00..36.33 rows=3D52 width=3D47) (act= ual time=3D0.012..0.034 rows=3D1 loops=3D345)"=0A= " Index Cond: (("st_ino")::bigint =3D ("p"= ."st_ino_target")::bigint)"=0A= " -> Nested Loop (cost=3D519.00..1168.21 rows=3D1 width=3D48) (act= ual time=3D0.236..0.304 rows=3D1 loops=3D490)"=0A= " Join Filter: ((B'00000000000000001111000000000000'::"bit" & = ("t"."st_mode")::"bit") =3D ("sb"."bits")::"bit")"=0A= " Rows Removed by Join Filter: 16"=0A= " -> Nested Loop (cost=3D0.00..648.01 rows=3D1 width=3D33) (= actual time=3D0.174..0.206 rows=3D1 loops=3D490)"=0A= " -> Nested Loop (cost=3D0.00..641.76 rows=3D1 width= =3D24) (actual time=3D0.145..0.176 rows=3D1 loops=3D490)"=0A= " -> Nested Loop (cost=3D0.00..635.50 rows=3D1 w= idth=3D32) (actual time=3D0.099..0.125 rows=3D1 loops=3D490)"=0A= " -> Nested Loop (cost=3D0.00..624.53 rows= =3D1 width=3D16) (actual time=3D0.096..0.107 rows=3D1 loops=3D490)"=0A= " -> Nested Loop (cost=3D0.00..602.1= 5 rows=3D1 width=3D16) (actual time=3D0.059..0.069 rows=3D1 loops=3D490)"= =0A= " -> Index Scan using "ix_inode= _segments_st_inos" on "inode_segments" "fi" (cost=3D0.00..21.51 rows=3D52 = width=3D16) (actual time=3D0.004..0.004 rows=3D1 loops=3D490)"=0A= " Index Cond: (("st_ino"):= :bigint =3D ("fn"."st_ino_target")::bigint)"=0A= " -> Index Scan using "pk_inode= _segments" on "inode_segments" "mv" (cost=3D0.00..11.16 rows=3D1 width=3D1= 6) (actual time=3D0.053..0.062 rows=3D1 loops=3D503)"=0A= " Index Cond: ((("st_ino")= ::bigint =3D ("fi"."st_ino_target")::bigint) AND (("segment_index")::"text"= =3D 'thumbnail.with_name'::"text"))"=0A= " -> Index Scan using "ix_inode_segme= nts_st_inos" on "inode_segments" "fd" (cost=3D0.00..21.86 rows=3D52 width= =3D16) (actual time=3D0.050..0.051 rows=3D1 loops=3D355)"=0A= " Index Cond: (("st_ino")::bigin= t =3D ("mv"."st_ino_target")::bigint)"=0A= " -> Index Scan using "ix_inode_segments_st= _ino_targets" on "inode_segments" "p" (cost=3D0.00..10.97 rows=3D1 width= =3D16) (actual time=3D0.003..0.023 rows=3D1 loops=3D355)"=0A= " Index Cond: (("st_ino_target")::bigi= nt =3D ("fd"."st_ino_target")::bigint)"=0A= " -> Index Scan using "pk_inodes" on "inodes" "i"= (cost=3D0.00..6.25 rows=3D1 width=3D8) (actual time=3D0.069..0.069 rows= =3D1 loops=3D355)"=0A= " Index Cond: (("st_ino")::bigint =3D ("p"."= st_ino")::bigint)"=0A= " Filter: ((("st_ino")::bigint =3D 2) OR ((B= '00000000000000001111000000000000'::"bit" & ("st_mode")::"bit") =3D B'00000= 000000000000100000000000000'::"bit"))"=0A= " -> Index Scan using "pk_inodes" on "inodes" "t" (cos= t=3D0.00..6.24 rows=3D1 width=3D21) (actual time=3D0.039..0.040 rows=3D1 lo= ops=3D355)"=0A= " Index Cond: (("st_ino")::bigint =3D ("p"."st_ino= _target")::bigint)"=0A= " -> CTE Scan on "stat_h_with_bits" "sb" (cost=3D519.00..519= .63 rows=3D23 width=3D72) (actual time=3D0.001..0.010 rows=3D23 loops=3D355= )"=0A= " CTE stat_h"=0A= " -> Values Scan on "*VALUES*" (cost=3D0.00..0.29 ro= ws=3D23 width=3D68) (actual time=3D0.002..0.023 rows=3D23 loops=3D1)"=0A= " CTE stat_h_with_bits"=0A= " -> CTE Scan on "stat_h" "s" (cost=3D0.00..518.71 r= ows=3D23 width=3D68) (actual time=3D0.059..0.499 rows=3D23 loops=3D1)"=0A= " SubPlan 12"=0A= " -> Aggregate (cost=3D22.51..22.52 rows=3D1= width=3D32) (actual time=3D0.012..0.012 rows=3D1 loops=3D23)"=0A= " -> Function Scan on "regexp_split_to_= table" "digits" (cost=3D0.01..10.01 rows=3D1000 width=3D32) (actual time= =3D0.007..0.008 rows=3D3 loops=3D23)"=0A= " SubPlan 3"=0A= " -> Aggregate (cost=3D36.46..36.47 rows=3D1 width=3D47) (= actual time=3D0.117..0.117 rows=3D1 loops=3D355)"=0A= " -> Index Scan using "ix_inode_segments_st_inos" on = "inode_segments" "fs" (cost=3D0.00..36.33 rows=3D52 width=3D47) (actual ti= me=3D0.039..0.040 rows=3D1 loops=3D355)"=0A= " Index Cond: (("st_ino")::bigint =3D ("p"."st_i= no_target")::bigint)"=0A= " SubPlan 1"=0A= " -> Aggregate (cost=3D36.46..36.47 rows=3D1 width=3D47) (actual= time=3D0.250..0.251 rows=3D1 loops=3D500)"=0A= " -> Index Scan using "ix_inode_segments_st_inos" on "inode= _segments" "fs" (cost=3D0.00..36.33 rows=3D52 width=3D47) (actual time=3D0= .002..0.002 rows=3D1 loops=3D500)"=0A= " Index Cond: (("st_ino")::bigint =3D ("p"."st_ino_tar= get")::bigint)"=0A= "Total runtime: 44702.582 ms"BLOAT:schemaname tblname idxname real_s= ize bloat_size=0A= gorfs inode_segments "ix_inode_segments_gsdi_pk" 4246921216 97327= 5136=0A= gorfs inode_segments "ix_inode_segments_ja_files_lookup" 184844288 59793= 408=0A= gorfs inode_segments "ix_inode_segments_notes_clientids" 187555840 62504= 960=0A= gorfs inode_segments "ix_inode_segments_notes_fileids" 247037952 12198= 7072=0A= gorfs inode_segments "ix_inode_segments_notes_noteids" 230473728 10542= 2848 = --_6dffb1a4-abcd-451d-847a-49219f628988_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

The binary columns ar= e large so I think that's why the query referencing them is slow.

PostgreSQL 9.2

Is there a way to speed it up=2C maybe co= mpression on transfer? Some indexes has millions of rows...

May= be create an index to some specifics situations=2C and not general ones.


Thank you.


QUERY:

SELECT ni.segment_index AS note_id=2C=0A=
       f.inode_id AS file_id=2C=0A=
       f.node_full_path AS filename=2C=0A=
       f.last_changed AS date_created=2C=0A=
       f.file_data AS main_binary=2C=0A=
       medium.=
inode_id AS medium_id=2C=0A=
       medium.=
file_data AS medium_binary=2C=0A=
       thumbnail.inode_id AS thumbnail_id=2C=
=0A=
       thumbnail.file_data AS thumbnail_binary=0A=
FROM gorfs.nodes AS f=0A=
INNER JOIN gorfs.=
inode_segments AS fd ON fd.st_ino_target =3D f.inode_id=0A=
INNER JOIN gorfs.=
inode_segments AS mv ON mv.st_ino_target =3D fd.st_ino=0A=
AND mv.segment_index =3D 'main.with_name'=0A=
INNER JOIN gorfs.=
inode_segments AS fi ON fi.st_ino_target =3D mv.st_ino=0A=
INNER JOIN gorfs.=
inode_segments AS fn ON fn.st_ino_target =3D fi.st_ino=0A=
INNER JOIN gorfs.=
inode_segments AS ni ON ni.st_ino_target =3D fn.st_ino=0A=
LEFT JOIN=0A=
  (SELECT f.inode_id=
=2C=0A=
          f.<=
span class=3D"pln" style=3D"margin: 0px=3B padding: 0px=3B border: 0px=3B f=
ont-size: 13px=3B color: rgb(0=2C 0=2C 0)=3B">file_data=2C=0A=
          fi.<=
span class=3D"pln" style=3D"margin: 0px=3B padding: 0px=3B border: 0px=3B f=
ont-size: 13px=3B color: rgb(0=2C 0=2C 0)=3B">st_ino=0A=
   FROM gorfs.nodes AS f=0A=
   INNER JOIN gorfs.inode_segments AS fd ON fd.st_ino_target =3D f.inode_id=0A=
   INNER JOIN gorfs.inode_segments AS mv ON mv.st_ino_target =3D fd.st_ino=0A=
   AND mv.segment_index =
=3D 'medium.with_name'=0A=
   INNER JOIN gorfs.inode_segments AS fi ON fi.st_ino_target =3D mv.st_ino ) AS<=
span class=3D"pln" style=3D"margin: 0px=3B padding: 0px=3B border: 0px=3B f=
ont-size: 13px=3B color: rgb(0=2C 0=2C 0)=3B"> medium ON medium.st_ino =3D fn.st_ino_target=
=0A=
LEFT JOIN=0A=
  (SELECT f.inode_id=
=2C=0A=
          f.<=
span class=3D"pln" style=3D"margin: 0px=3B padding: 0px=3B border: 0px=3B f=
ont-size: 13px=3B color: rgb(0=2C 0=2C 0)=3B">file_data=2C=0A=
          fi.<=
span class=3D"pln" style=3D"margin: 0px=3B padding: 0px=3B border: 0px=3B f=
ont-size: 13px=3B color: rgb(0=2C 0=2C 0)=3B">st_ino=0A=
   FROM gorfs.nodes AS f=0A=
   INNER JOIN gorfs.inode_segments AS fd ON fd.st_ino_target =3D f.inode_id=0A=
   INNER JOIN gorfs.inode_segments AS mv ON mv.st_ino_target =3D fd.st_ino=0A=
   AND mv.segment_index =
=3D 'thumbnail.with_name'=0A=
   INNER JOIN gorfs.inode_segments AS fi ON fi.st_ino_target =3D mv.st_ino ) AS<=
span class=3D"pln" style=3D"margin: 0px=3B padding: 0px=3B border: 0px=3B f=
ont-size: 13px=3B color: rgb(0=2C 0=2C 0)=3B"> thumbnail ON thumbnail.st_ino =3D fn.st_i=
no_target=0A=
WHERE f.file_data IS NOT NU=
LL LIMIT 500=3B

EXPLAIN ANALYZE:

"Limit  (cost=3D20243.45..1593866.18 rows=3D500 wid=
th=3D180) (actual time=3D210.036..44701.406 rows=3D500 loops=3D1)"=0A=
"  ->=3B  Nested =
Loop Left Join  (cost=3D20243.45..757747912.38 rows=3D240759 width=3D180) (=
actual time=3D210.036..44701.223 rows=3D500 loops=3D1)"=0A=
"        ->=3B  N=
ested Loop Left Join  (cost=3D19724.45..450144827.58 rows=3D240759 width=3D=
148) (actual time=3D196.881..44353.113 rows=3D490 loops=3D1)"=0A=
"              ->=
=3B  Nested Loop  (cost=3D19205.46..168833316.21 rows=3D240759 width=3D108)=
 (actual time=3D196.239..43707.952 rows=3D486 loops=3D1)"=0A=
"                  =
  ->=3B  Nested Loop  (cost=3D19205.46..164947484.34 rows=3D354030 width=
=3D107) (actual time=3D196.233..43706.095 rows=3D486 loops=3D1)"=0A=
"                  =
        ->=3B  Nested Loop  (cost=3D19205.46..159233457.64 rows=3D520593 =
width=3D99) (actual time=3D196.223..43704.141 rows=3D486 loops=3D1)"=
=0A=
"                  =
              ->=3B  Nested Loop  (cost=3D19205.46..153056028.27 rows=3D9=
87163 width=3D107) (actual time=3D196.202..43700.535 rows=3D486 loops=3D1)"=
=0A=
"                  =
                    Join Filter: ((("t".=
"st_ino")::bigint =3D ("p"."st_ino_target")::=
bigint) AND (CASE WHEN ("f"."constant_name" =3D 'S_IFREG'::"gorfs"."mode_t_constant_name") THEN (SubPlan 4) ELSE NULL::"bytea" END IS NOT NULL))"=0A=
"                  =
                    ->=3B  Nested Loop  (cost=3D19205.46..83831623.03 row=
s=3D1458893 width=3D36) (actual time=3D155.629..43307.564 rows=3D486 loops=
=3D1)"=0A=
"                  =
                          Join Filter: ((B'00000000000000001111000000000000=
'::"bit" &=3B ("t"."st=
_mode")::"bit") =3D ("f"=
."bits")::"bit")"=0A=
"                  =
                          Rows Removed by Join Filter: 10673"=0A=
"                  =
                          ->=3B  Nested Loop  (cost=3D18686.46..83243898.=
69 rows=3D1458893 width=3D41) (actual time=3D155.432..43302.768 rows=3D486 =
loops=3D1)"=0A=
"                  =
                                ->=3B  Nested Loop  (cost=3D18686.46..595=
43972.56 rows=3D2145267 width=3D41) (actual time=3D155.420..43300.521 rows=
=3D486 loops=3D1)"=0A=
"                  =
                                      ->=3B  Merge Join  (cost=3D18686.46=
..29848042.37 rows=3D4751151 width=3D16) (actual time=3D155.397..43289.955 =
rows=3D486 loops=3D1)"=0A=
"                  =
                                            Merge Cond: (("fd"."st_ino")::big=
int =3D ("mv=
"."st_ino_target")::bigint)"=0A=
"                  =
                                            ->=3B  Index Scan using "ix_inode_segments_st_ino=
s" on "inode_segments" "fd"  (cost=3D0.00..24356396.96 rows=3D83232691 width=3D16) (actual time=
=3D0.080..43016.366 rows=3D2037019 loops=3D1)"=0A=
"                  =
                                            ->=3B  Index Scan using "ix_inode_segments_climb_=
tree" on "inode_segments" "mv"  (cost=3D0.00..7695601.08 rows=3D6986452 width=3D16) (actual time=3D=
0.197..96.693 rows=3D487 loops=3D1)"=0A=
"                  =
                                                  Index Cond: (("segment_index")::"text" =3D 'main.with_name'::"text")"=0A=
"                  =
                                      ->=3B  Index Scan using "pk_inodes" on "inodes" "t"  (cost=3D0.00..6.24 rows=3D1=
 width=3D29) (actual time=3D0.020..0.020 rows=3D1 loops=3D486)"=0A=
"                  =
                                            Index Cond: (("st_ino")::bigint =3D ("fd"."st_ino_target=
")::bigint)"=
=0A=
"                  =
                                ->=3B  Index Scan using "ix_inode_segments_st_ino_targets" on "inode_segments" "fi"=
  (cost=3D0.00..11.04 rows=3D1 width=3D16) (actual time=3D0.003..0.004 rows=
=3D1 loops=3D486)"=0A=
"                  =
                                      Index Cond: (("st_ino_target")::bigint =3D ("mv"."st_ino=
")::bigint)"=0A=
"                  =
                          ->=3B  Materialize  (cost=3D519.00..519.97 rows=
=3D23 width=3D36) (actual time=3D0.001..0.003 rows=3D23 loops=3D486)"=0A=
"                  =
                                ->=3B  Subquery Scan on "f"  (cost=3D519.00..519.86 rows=3D23 width=3D36) (actual=
 time=3D0.138..0.452 rows=3D23 loops=3D1)"=0A=
"                  =
                                      ->=3B  CTE Scan on "stat_h_with_bits" "sb"  (cost=3D519.00..519.63 rows=3D23 width=3D72) (actual time=3D0.137..=
0.447 rows=3D23 loops=3D1)"=0A=
"                  =
                                            CTE stat_h"=0A=
"                  =
                                              ->=3B  Values Scan on "*VALUES*"  (cost=3D0.00..0.29 rows=3D23 width=3D68) (actual time=3D0.007..0.030 ro=
ws=3D23 loops=3D1)"=
=0A=
"                  =
                                            CTE stat_h_with_bits"=0A=
"                  =
                                              ->=3B  CTE Scan on "=
stat_h" "s" =
 (cost=3D0.00..518.71 rows=3D23 width=3D68) (actual time=3D0.120..0.407 row=
s=3D23 loops=3D1)"=0A=
"                  =
                                                    SubPlan 6"=0A=
"                  =
                                                      ->=3B  Aggregate  (=
cost=3D22.51..22.52 rows=3D1 width=3D32) (actual time=3D0.013..0.013 rows=
=3D1 loops=3D23)"=0A=
"                  =
                                                            ->=3B  Functi=
on Scan on "regexp_sp=
lit_to_table" "digits"  (cost=3D0.01..10.01 rows=3D1000 wi=
dth=3D32) (actual time=3D0.008..0.009 rows=3D3 loops=3D23)"=0A=
"                  =
                    ->=3B  Index Scan using "ix_inode_segments_st_ino_targets" on "inode_segments" "p"  (cost=3D0.00..=
10.97 rows=3D1 width=3D79) (actual time=3D0.002..0.002 rows=3D1 loops=3D486=
)"=0A=
"                  =
                          Index Cond: (("st_ino_target")::bigint =3D ("fd"."st_ino_target")::bigint)"=0A=
"                  =
                    SubPlan 4"=0A=
"                  =
                      ->=3B  Aggregate  (cost=3D36.46..36.47 rows=3D1 wid=
th=3D47) (actual time=3D0.712..0.712 rows=3D1 loops=3D486)"=0A=
"                  =
                            ->=3B  Index Scan using "ix_inode_segments_st_inos" on "inode_segments" "fs"  (cost=
=3D0.00..36.33 rows=3D52 width=3D47) (actual time=3D0.003..0.004 rows=3D1 l=
oops=3D486)"=0A=
"                  =
                                  Index Cond: (("st_ino")::bigint =3D ("p"."st_ino_target")::bigint)"=0A=
"                  =
              ->=3B  Index Scan using "pk_inodes" on "ino=
des" "i"  (cost=3D0.00..6.25 rows=3D1 width=3D8) (actual t=
ime=3D0.006..0.006 rows=3D1 loops=3D486)"=0A=
"                  =
                    Index Cond: (("st_ino")::bigint =3D ("p"."st_ino")::bigint)"=0A=
"                  =
                    Filter: ((("st_ino")=
::bigint =3D 2) OR ((B'00000000000000001111000000000000'::"bit" &=3B ("st_mode")::"bit") =3D B'0000000000000000=
0100000000000000'::"b=
it"))"=0A=
"                  =
        ->=3B  Index Scan using "ix_inode_segments_st_ino_targets" on "inode_segments" "fn"  (cost=3D0.00..10.97=
 rows=3D1 width=3D16) (actual time=3D0.003..0.003 rows=3D1 loops=3D486)"=0A=
"                  =
              Index Cond: (("st_ino_target")::bigint =3D ("fi=
"."st_ino")::bigint)"=0A=
"                  =
  ->=3B  Index Scan using "ix_inode_segments_st_ino_targets" on "inode_segments" "ni"  (cost=3D0.00..10.97 rows=3D1 w=
idth=3D17) (actual time=3D0.003..0.003 rows=3D1 loops=3D486)"=0A=
"                  =
        Index Cond: (("st_ino_target")::=
bigint =3D ("fn"."st_ino")::bigint)"=0A=
"              ->=
=3B  Nested Loop  (cost=3D519.00..1168.43 rows=3D1 width=3D48) (actual time=
=3D1.296..1.326 rows=3D1 loops=3D486)"=0A=
"                  =
  Join Filter: ((B'00000000000000001111000000000000'::"bit" &=3B ("t"."st_mode")::"bit") =3D ("s=
b"."bits")::"bit")"=0A=
"                  =
  Rows Removed by Join Filter: 16"=0A=
"                  =
  ->=3B  Nested Loop  (cost=3D0.00..648.22 rows=3D1 width=3D33) (actual t=
ime=3D1.079..1.080 rows=3D1 loops=3D486)"=0A=
"                  =
        ->=3B  Nested Loop  (cost=3D0.00..641.97 rows=3D1 width=3D24) (ac=
tual time=3D1.076..1.077 rows=3D1 loops=3D486)"=0A=
"                  =
              ->=3B  Nested Loop  (cost=3D0.00..635.72 rows=3D1 width=3D3=
2) (actual time=3D1.026..1.027 rows=3D1 loops=3D486)"=0A=
"                  =
                    ->=3B  Nested Loop  (cost=3D0.00..624.74 rows=3D1 wid=
th=3D16) (actual time=3D0.981..0.982 rows=3D1 loops=3D486)"=0A=
"                  =
                          ->=3B  Nested Loop  (cost=3D0.00..602.15 rows=
=3D1 width=3D16) (actual time=3D0.964..0.965 rows=3D1 loops=3D486)"<=
span class=3D"pln" style=3D"margin: 0px=3B padding: 0px=3B border: 0px=3B f=
ont-size: 13px=3B color: rgb(0=2C 0=2C 0)=3B">=0A=
"                  =
                                ->=3B  Index Scan using "ix_inode_segments_st_inos" on "inode_segments" "fi"  (cost=
=3D0.00..21.51 rows=3D52 width=3D16) (actual time=3D0.003..0.003 rows=3D1 l=
oops=3D486)"=0A=
"                  =
                                      Index Cond: (("st_ino")::bigint =3D ("fn"=
."st_ino_target")::bigint)"=0A=
"                  =
                                ->=3B  Index Scan using "pk_inode_segments" on "inode_segments" "=
mv"  (cost=3D0.00..=
11.16 rows=3D1 width=3D16) (actual time=3D0.947..0.947 rows=3D1 loops=3D493=
)"=0A=
"                  =
                                      Index Cond: ((("st_ino")::bigint =3D ("fi"=
."st_ino_target")::bigint) AND (("segment_index")::"text" =3D 'medium.with_name'::"text"))"=0A=
"                  =
                          ->=3B  Index Scan using "ix_inode_segments_st_inos" on "inode_segments" "=
fd"  (cost=3D0.00..=
22.07 rows=3D52 width=3D16) (actual time=3D0.023..0.023 rows=3D1 loops=3D34=
5)"=0A=
"                  =
                                Index Cond: (("st_ino")::bigint =3D ("mv"."st_ino_target")::bigint)"=0A=
"                  =
                    ->=3B  Index Scan using "ix_inode_segments_st_ino_targets" on "inode_segments" "p"  (cost=3D0.00..=
10.97 rows=3D1 width=3D16) (actual time=3D0.062..0.062 rows=3D1 loops=3D345=
)"=0A=
"                  =
                          Index Cond: (("st_ino_target")::bigint =3D ("fd"."st_ino_target")::bigint)"=0A=
"                  =
              ->=3B  Index Scan using "pk_inodes" on "ino=
des" "i"  (cost=3D0.00..6.25 rows=3D1 width=3D8) (actual t=
ime=3D0.069..0.069 rows=3D1 loops=3D345)"=0A=
"                  =
                    Index Cond: (("st_ino")::bigint =3D ("p"."st_ino")::bigint)"=0A=
"                  =
                    Filter: ((("st_ino")=
::bigint =3D 2) OR ((B'00000000000000001111000000000000'::"bit" &=3B ("st_mode")::"bit") =3D B'0000000000000000=
0100000000000000'::"b=
it"))"=0A=
"                  =
        ->=3B  Index Scan using "pk_inodes" on "inodes" "t"  (cost=3D0.00..6.24 rows=3D1 width=3D21) (actual time=
=3D0.003..0.003 rows=3D1 loops=3D345)"=0A=
"                  =
              Index Cond: (("st_ino")::b=
igint =3D ("p<=
span class=3D"str" style=3D"margin: 0px=3B padding: 0px=3B border: 0px=3B f=
ont-size: 13px=3B color: rgb(128=2C 0=2C 0)=3B">"."st_ino_target")::bigint)"=0A=
"                  =
  ->=3B  CTE Scan on "stat_h_with_bits" "sb"  (cost=3D519.00..519.63 rows=3D=
23 width=3D72) (actual time=3D0.002..0.010 rows=3D23 loops=3D345)"=0A=
"                  =
        CTE stat_h"=
=0A=
"                  =
          ->=3B  Values Scan on "*VA=
LUES*"  (cost=3D0.00..0.29 rows=3D23 wid=
th=3D68) (actual time=3D0.003..0.025 rows=3D23 loops=3D1)"=0A=
"                  =
        CTE stat_h_with_bits"=0A=
"                  =
          ->=3B  CTE Scan on "stat_h" =
"s"  (cost=3D0.00..518.71 rows=3D23 wid=
th=3D68) (actual time=3D0.101..0.419 rows=3D23 loops=3D1)"=0A=
"                  =
                SubPlan 9"=0A=
"                  =
                  ->=3B  Aggregate  (cost=3D22.51..22.52 rows=3D1 width=
=3D32) (actual time=3D0.012..0.012 rows=3D1 loops=3D23)"=0A=
"                  =
                        ->=3B  Function Scan on "regexp_split_to_table" "digits"  (cost=3D0.01..10.01 rows=3D1000 width=3D32) (actual time=3D0.008..0=
.008 rows=3D3 loops=3D23)"=0A=
"                  =
  SubPlan 2"=0A=
"                  =
    ->=3B  Aggregate  (cost=3D36.46..36.47 rows=3D1 width=3D47) (actual t=
ime=3D0.314..0.314 rows=3D1 loops=3D345)"=0A=
"                  =
          ->=3B  Index Scan using "ix_inode_segments_st_inos" on "inode_segments" "fs"  (cost=3D0.00..36.33 rows=
=3D52 width=3D47) (actual time=3D0.012..0.034 rows=3D1 loops=3D345)"=
=0A=
"                  =
                Index Cond: (("st_ino")=
::bigint =3D ("p"."st_ino_target")::bigint)"=0A=
"        ->=3B  N=
ested Loop  (cost=3D519.00..1168.21 rows=3D1 width=3D48) (actual time=3D0.2=
36..0.304 rows=3D1 loops=3D490)"=0A=
"              Join=
 Filter: ((B'00000000000000001111000000000000'::"bit" &=3B ("t"."st_mode")::"bit") =3D ("sb=
"."bits")::"bit")"=0A=
"              Rows=
 Removed by Join Filter: 16"=0A=
"              ->=
=3B  Nested Loop  (cost=3D0.00..648.01 rows=3D1 width=3D33) (actual time=3D=
0.174..0.206 rows=3D1 loops=3D490)"=0A=
"                  =
  ->=3B  Nested Loop  (cost=3D0.00..641.76 rows=3D1 width=3D24) (actual t=
ime=3D0.145..0.176 rows=3D1 loops=3D490)"=0A=
"                  =
        ->=3B  Nested Loop  (cost=3D0.00..635.50 rows=3D1 width=3D32) (ac=
tual time=3D0.099..0.125 rows=3D1 loops=3D490)"=0A=
"                  =
              ->=3B  Nested Loop  (cost=3D0.00..624.53 rows=3D1 width=3D1=
6) (actual time=3D0.096..0.107 rows=3D1 loops=3D490)"=0A=
"                  =
                    ->=3B  Nested Loop  (cost=3D0.00..602.15 rows=3D1 wid=
th=3D16) (actual time=3D0.059..0.069 rows=3D1 loops=3D490)"=0A=
"                  =
                          ->=3B  Index Scan using "ix_inode_segments_st_inos" on "inode_segments" "=
fi"  (cost=3D0.00..=
21.51 rows=3D52 width=3D16) (actual time=3D0.004..0.004 rows=3D1 loops=3D49=
0)"=0A=
"                  =
                                Index Cond: (("st_ino")::bigint =3D ("fn"."st_ino_target")::bigint)"=0A=
"                  =
                          ->=3B  Index Scan using "pk_inode_segments" on "inode_segments" "mv"  (cost=3D0.00..11.16=
 rows=3D1 width=3D16) (actual time=3D0.053..0.062 rows=3D1 loops=3D503)"=0A=
"                  =
                                Index Cond: ((("st_ino")::bigint =3D ("fi"."st_ino_target")::bigint) AND (("segment_index")::"text" =3D 'thumbnail.with_name'::"text"))"=0A=
"                  =
                    ->=3B  Index Scan using "ix_inode_segments_st_inos" on "inode_segments" "fd=
"  (cost=3D0.00..21=
.86 rows=3D52 width=3D16) (actual time=3D0.050..0.051 rows=3D1 loops=3D355)=
"=0A=
"                  =
                          Index Cond: (("st_ino")::bigint =3D ("mv"."=
st_ino_target")::bigint)"=0A=
"                  =
              ->=3B  Index Scan using "ix_inode_segments_st_ino_targets" on "inode_segments" "p=
"  (cost=3D0.00..10=
.97 rows=3D1 width=3D16) (actual time=3D0.003..0.023 rows=3D1 loops=3D355)"=
=0A=
"                  =
                    Index Cond: (("st_ino_target")::bigint =3D ("fd"."=
st_ino_target")::bigint)"=0A=
"                  =
        ->=3B  Index Scan using "pk_inodes" on "inodes" "i"  (cost=3D0.00..6.25 rows=3D1 width=3D8) (actual time=3D=
0.069..0.069 rows=3D1 loops=3D355)"=0A=
"                  =
              Index Cond: (("st_ino")::b=
igint =3D ("p<=
span class=3D"str" style=3D"margin: 0px=3B padding: 0px=3B border: 0px=3B f=
ont-size: 13px=3B color: rgb(128=2C 0=2C 0)=3B">"."st_ino")::bigint)"=0A=
"                  =
              Filter: ((("st_ino")::bi=
gint =3D 2) OR ((B'00000000000000001111000000000000'::"bit" &=3B ("st_mode"=
)::"bit") =3D B'000000000000000001000000=
00000000'::"bit"))"=0A=
"                  =
  ->=3B  Index Scan using "pk_inodes" =
on "inodes" "t"  (cost=3D0.00..6.24 rows=3D1 width=3D21) (actual time=3D0.039.=
.0.040 rows=3D1 loops=3D355)"=0A=
"                  =
        Index Cond: (("st_ino")::bigint =
=3D ("p"."st_ino_target")::bigint)"=0A=
"              ->=
=3B  CTE Scan on "sta=
t_h_with_bits" "sb"  (cost=3D519.00..519.63 rows=3D23 width=
=3D72) (actual time=3D0.001..0.010 rows=3D23 loops=3D355)"=0A=
"                  =
  CTE stat_h"=0A=
"                  =
    ->=3B  Values Scan on "*VALUES*"  (cost=3D0.00..0.29 rows=3D23 width=3D6=
8) (actual time=3D0.002..0.023 rows=3D23 loops=3D1)"=0A=
"                  =
  CTE stat_h_with_bits"=0A=
"                  =
    ->=3B  CTE Scan on "stat_h" "s"  (cost=3D0.00..518.71 rows=3D23 width=
=3D68) (actual time=3D0.059..0.499 rows=3D23 loops=3D1)"=0A=
"                  =
          SubPlan 12"=
=0A=
"                  =
            ->=3B  Aggregate  (cost=3D22.51..22.52 rows=3D1 width=3D32) (=
actual time=3D0.012..0.012 rows=3D1 loops=3D23)"=0A=
"                  =
                  ->=3B  Function Scan on "regexp_split_to_table" "digits"  (c=
ost=3D0.01..10.01 rows=3D1000 width=3D32) (actual time=3D0.007..0.008 rows=
=3D3 loops=3D23)"=0A=
"              SubP=
lan 3"=0A=
"                -&=
gt=3B  Aggregate  (cost=3D36.46..36.47 rows=3D1 width=3D47) (actual time=3D=
0.117..0.117 rows=3D1 loops=3D355)"=0A=
"                  =
    ->=3B  Index Scan using "ix_inode_segments_st_inos" on "inode_segments" "=
fs"  (cost=3D0.00..36.33 rows=3D52 widt=
h=3D47) (actual time=3D0.039..0.040 rows=3D1 loops=3D355)"=0A=
"                  =
          Index Cond: (("st_ino")::big=
int =3D ("p<=
span class=3D"str" style=3D"margin: 0px=3B padding: 0px=3B border: 0px=3B f=
ont-size: 13px=3B color: rgb(128=2C 0=2C 0)=3B">"."st_ino_target")::bigint)"=0A=
"        SubPlan 1"=
=0A=
"          ->=3B =
 Aggregate  (cost=3D36.46..36.47 rows=3D1 width=3D47) (actual time=3D0.250.=
.0.251 rows=3D1 loops=3D500)"=0A=
"                -&=
gt=3B  Index Scan using "ix_inode_segments_st_inos" on "inod=
e_segments" "fs"  (cost=3D0.00..36.33 rows=3D52 width=3D=
47) (actual time=3D0.002..0.002 rows=3D1 loops=3D500)"=0A=
"                  =
    Index Cond: (("st=
_ino")::bigint =3D =
("p"."st_ino_target")::bigint)"=0A=
"Total runtime: 447=
02.582 ms"

BLOA= T:

scheman=
ame   tblname   idxname    real_size    bloat_size=0A=
gorfs  inode_segments    "ix_inode_segments_gsdi_pk"   4246=
921216     973275136=0A=
gorfs  inode_segments  "ix_inode_segments_ja_files_lookup" 184844288  =
59793408=0A=
gorfs  inode_segments  "ix_inode_segments_notes_clientids" 187555840  =
62504960=0A=
gorfs  inode_segments "ix_inode_segments_notes_fileids"   247037952   121987072=0A=
gorfs  inode_segments "ix_inode_segments_notes_noteids"   230473728   105422848 		 	   		  
= --_6dffb1a4-abcd-451d-847a-49219f628988_--