Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aIMuo-0003YK-Am for pgsql-general@arkaria.postgresql.org; Sun, 10 Jan 2016 20:48:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aIMun-0003rc-Qr for pgsql-general@arkaria.postgresql.org; Sun, 10 Jan 2016 20:48:41 +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 1aIMuk-0003qr-RJ for pgsql-general@postgresql.org; Sun, 10 Jan 2016 20:48:39 +0000 Received: from snt004-omc2s33.hotmail.com ([65.55.90.108]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aIMuc-0007Hk-C6 for pgsql-general@postgresql.org; Sun, 10 Jan 2016 20:48:37 +0000 Received: from SNT147-W42 ([65.55.90.72]) by SNT004-OMC2S33.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Sun, 10 Jan 2016 12:48:29 -0800 X-TMN: [9lUDwCn6GB8ji3W9cse7xJIcee9iEdJO] X-Originating-Email: [smerlo50@outlook.com] Message-ID: Content-Type: multipart/alternative; boundary="_8bce3c54-937f-4676-a46d-b0558782dc37_" From: Saulo Merlo To: "pgsql-general@postgresql.org" Subject: Large Binary Columns - Slow Query Date: Sun, 10 Jan 2016 20:48:29 +0000 Importance: Normal In-Reply-To: References: MIME-Version: 1.0 X-OriginalArrivalTime: 10 Jan 2016 20:48:29.0642 (UTC) FILETIME=[42D842A0:01D14BE8] X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org --_8bce3c54-937f-4676-a46d-b0558782dc37_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable =0A= 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 = --_8bce3c54-937f-4676-a46d-b0558782dc37_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
=0A=

The bina= ry columns are large so I think that's why the query referencing them is sl= ow.

PostgreSQL 9.2

Is there a way to spee= d 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<=
span class=3D"ecxpln" style=3D"padding:0px=3Bborder:0px=3Bfont-size:13px=3B=
color:rgb(0=2C 0=2C 0)=3B">=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<=
span class=3D"ecxpln" style=3D"padding:0px=3Bborder:0px=3Bfont-size:13px=3B=
color:rgb(0=2C 0=2C 0)=3B"> fd.st_ino_target =
=3D f=
.inode_id=0A=
INNER JOIN gorfs.inode_segments AS mv ON<=
span class=3D"ecxpln" style=3D"padding:0px=3Bborder:0px=3Bfont-size:13px=3B=
color:rgb(0=2C 0=2C 0)=3B"> 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<=
span class=3D"ecxpln" style=3D"padding:0px=3Bborder:0px=3Bfont-size:13px=3B=
color:rgb(0=2C 0=2C 0)=3B"> fi.st_ino_target =
=3D mv.st_ino=0A=
INNER JOIN gorfs.inode_segments AS fn ON<=
span class=3D"ecxpln" style=3D"padding:0px=3Bborder:0px=3Bfont-size:13px=3B=
color:rgb(0=2C 0=2C 0)=3B"> fn.st_ino_target =
=3D fi.st_ino=0A=
INNER JOIN gorfs.inode_segments AS ni ON<=
span class=3D"ecxpln" style=3D"padding:0px=3Bborder:0px=3Bfont-size:13px=3B=
color:rgb(0=2C 0=2C 0)=3B"> 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 <=
span class=3D"ecxpun" style=3D"padding:0px=3Bborder:0px=3Bfont-size:13px=3B=
color:rgb(0=2C 0=2C 0)=3B">=3D fn=
.st_ino_ta=
rget=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<=
span class=3D"ecxpun" style=3D"padding:0px=3Bborder:0px=3Bfont-size:13px=3B=
color:rgb(0=2C 0=2C 0)=3B">.st_ino =3D fn.st_ino_t=
arget=0A=
WHERE f.=
file_data IS NOT NULL LIMIT 500=3B

EXPLAIN ANALYZE:

"Limit  (cost=3D20243.45..1593866.1=
8 rows=3D500 width=3D180) (actual time=3D210.036..44701.406 rows=3D500 loop=
s=3D1)"=0A=
"  ->=3B  Nested Loop Left Join  (co=
st=3D20243.45..757747912.38 rows=3D240759 width=3D180) (actual time=3D210.0=
36..44701.223 rows=3D500 loops=3D1)"=0A=
"        ->=3B  Nested Loop Left Joi=
n  (cost=3D19724.45..450144827.58 rows=3D240759 width=3D148) (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 L=
oop  (cost=3D19205.46..164947484.34 rows=3D354030 width=3D107) (actual time=
=3D196.233..43706.095 rows=3D486 loops=3D1)"=0A=
"                          ->=3B  Ne=
sted 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=3D987163 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 WH=
EN ("f"."constant_name" =3D 'S_IFREG'::"gor=
fs"."mode_t_constant_name") THEN (SubPlan=
 4) ELSE NULL::"bytea" END IS NOT NULL))"=
=0A=
"                                     =
 ->=3B  Nested Loop  (cost=3D19205.46..83831623.03 rows=3D1458893 width=
=3D36) (actual time=3D155.629..43307.564 rows=3D486 loops=3D1)"=0A=
"                                     =
       Join Filter: ((B'00000000000000001111000000000000'::"bit" &=3B ("<=
/span>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 w=
idth=3D41) (actual time=3D155.432..43302.768 rows=3D486 loops=3D1)"<=
span class=3D"ecxpln" style=3D"padding:0px=3Bborder:0px=3Bfont-size:13px=3B=
color:rgb(0=2C 0=2C 0)=3B">=0A=
"                                     =
             ->=3B  Nested Loop  (cost=3D18686.46..59543972.56 rows=3D214=
5267 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")::bigint =3D ("mv"."st_ino_target")::bigint)"=0A=
"                                     =
                         ->=3B  Index Scan 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 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=3D0.197..96.693 rows=3D487 loops=3D1)"=0A=
"                                     =
                               Index Cond: (("segment_index")::"text" =3D 'main.w=
ith_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.0=
03..0.004 rows=3D1 loops=3D486)"=0A=
"                                     =
                   Index Cond: (("st_ino=
_target")::bigint =3D ("mv"."st_ino")::big=
int)"=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 w=
idth=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=3D=
1)"=0A=
"                                     =
                         CTE stat_h"=0A=
"                                     =
                           ->=3B  Values Scan on "*VALUES*"  (cost=3D0.00..0.2=
9 rows=3D23 width=3D68) (actual time=3D0.007..0.030 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.120..0.407 rows=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  Function Scan on "=
regexp_split_to_table" "digits"  (cost=3D0.01..10.01 rows=3D1000 width=3D32) (actual t=
ime=3D0.008..0.009 rows=3D3 loops=3D23)"=
=0A=
"                                     =
 ->=3B  Index Scan using "ix_inode_seg=
ments_st_ino_targets" on "inode_segments"=
 "p"  (cost=3D0.00..10.97 rows=3D1 width=3D79) (actual time=3D0.002..0.002 r=
ows=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 width=3D47) (actual ti=
me=3D0.712..0.712 rows=3D1 loops=3D486)"=
=0A=
"                                     =
         ->=3B  Index Scan using "ix_i=
node_segments_st_inos" on "inode_segments" "fs"  (cost=3D0.00..36.33 rows=3D52 width=3D47) (actual time=3D0.003..0.0=
04 rows=3D1 loops=3D486)"=0A=
"                                     =
               Index Cond: (("st_ino")::bigint =3D ("p"."st_ino_target")::bigint)"<=
/span>=0A=
"                                ->=
=3B  Index Scan using "pk_inodes" on "=
inodes" "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" &=3B ("st_mode")::"bit") =3D B'00000000000000000100000000000000'::"bit"))"<=
/span>=0A=
"                          ->=3B  In=
dex Scan using "ix_inode_segments_st_ino=
_targets" on "inode_segments" "fn"  (cost=3D=
0.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 Sc=
an using "ix_inode_segments_st_ino_tar=
gets" on "inode_segments" "ni"  (cost=3D0.=
00..10.97 rows=3D1 width=3D17) (actual time=3D0.003..0.003 rows=3D1 loops=
=3D486)"=0A=
"                          Index Cond:=
 (("st_ino_target")::bigint =3D ("fn"."st_in=
o")::bigint)"=0A=
"              ->=3B  Nested Loop  (=
cost=3D519.00..1168.43 rows=3D1 width=3D48) (actual time=3D1.296..1.326 row=
s=3D1 loops=3D486)"=0A=
"                    Join Filter: ((B'=
00000000000000001111000000000000'::"bit<=
/span>" &=3B ("t"."st_mode")::"bit") =3D ("sb"."bits"=
)::"bit")"=0A=
"                    Rows Removed by J=
oin Filter: 16"=0A=
"                    ->=3B  Nested L=
oop  (cost=3D0.00..648.22 rows=3D1 width=3D33) (actual time=3D1.079..1.080 =
rows=3D1 loops=3D486)"=0A=
"                          ->=3B  Ne=
sted Loop  (cost=3D0.00..641.97 rows=3D1 width=3D24) (actual time=3D1.076..=
1.077 rows=3D1 loops=3D486)"=0A=
"                                ->=
=3B  Nested Loop  (cost=3D0.00..635.72 rows=3D1 width=3D32) (actual time=3D=
1.026..1.027 rows=3D1 loops=3D486)"=0A=
"                                     =
 ->=3B  Nested Loop  (cost=3D0.00..624.74 rows=3D1 width=3D16) (actual ti=
me=3D0.981..0.982 rows=3D1 loops=3D486)"=
=0A=
"                                     =
       ->=3B  Nested Loop  (cost=3D0.00..602.15 rows=3D1 width=3D16) (act=
ual time=3D0.964..0.965 rows=3D1 loops=3D486)"=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 loops=3D486)"=0A=
"                                     =
                   Index Cond: (("st_ino=
")::bigint =3D ("fn"."st_ino_target")::big=
int)"=0A=
"                                     =
             ->=3B  Index Scan using "=
pk_inode_segments" on "inode_segments" "<=
/span>mv" =
 (cost=3D0.00..11.16 rows=3D1 width=3D16) (actual time=3D0.947..0.947 rows=
=3D1 loops=3D493)"=0A=
"                                     =
                   Index Cond: ((("st_in=
o")::bigint =3D ("fi"."st_ino_target")::bi=
gint) AND (("segment_index")::"text<=
span class=3D"ecxstr" style=3D"padding:0px=3Bborder:0px=3Bfont-size:13px=3B=
color:rgb(128=2C 0=2C 0)=3B">" =3D 'medium.with_name'::"text"))"=0A=
"                                     =
       ->=3B  Index Scan using "ix_ino=
de_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=
"                                     =
 ->=3B  Index Scan using "ix_inode_seg=
ments_st_ino_targets" on "inode_segments"=
 "p"  (cost=3D0.00..10.97 rows=3D1 width=3D16) (actual time=3D0.062..0.062 r=
ows=3D1 loops=3D345)"=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=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'00000000000000000100000000000000'::"bit"))"<=
/span>=0A=
"                          ->=3B  In=
dex 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_in=
o_target")::bigint)"=0A=
"                    ->=3B  CTE Scan=
 on "stat_h_with_bits" "sb"  (cost=3D519.00..519.63 rows=3D23 width=3D72) (actua=
l time=3D0.002..0.010 rows=3D23 loops=3D345)"=0A=
"                          CTE stat_h"=
=0A=
"                            ->=3B  =
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=
"                            ->=3B  =
CTE Scan on "stat_h" "s"  (cost=3D0.00..518.71 rows=3D23 width=3D68) (actual ti=
me=3D0.101..0.419 rows=3D23 loops=3D1)"=
=0A=
"                                  Sub=
Plan 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_s=
plit_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  Aggreg=
ate  (cost=3D36.46..36.47 rows=3D1 width=3D47) (actual time=3D0.314..0.314 =
rows=3D1 loops=3D345)"=0A=
"                            ->=3B  =
Index Scan using "ix_inode_segments_st_i=
nos" on "inode_segments" "fs"  (cost=3D0.00.=
.36.33 rows=3D52 width=3D47) (actual time=3D0.012..0.034 rows=3D1 loops=3D3=
45)"=0A=
"                                  Ind=
ex Cond: (("st_ino")::bigint =3D ("p"."st_in=
o_target")::bigint)"=0A=
"        ->=3B  Nested Loop  (cost=
=3D519.00..1168.21 rows=3D1 width=3D48) (actual time=3D0.236..0.304 rows=3D=
1 loops=3D490)"=0A=
"              Join Filter: ((B'000000=
00000000001111000000000000'::"bit=
" &=3B ("t"."st_mode")::"bit") =3D ("sb"."=
bits")::=
"bit")"=0A=
"              Rows Removed by Join Fi=
lter: 16"=0A=
"              ->=3B  Nested Loop  (=
cost=3D0.00..648.01 rows=3D1 width=3D33) (actual time=3D0.174..0.206 rows=
=3D1 loops=3D490)"=0A=
"                    ->=3B  Nested L=
oop  (cost=3D0.00..641.76 rows=3D1 width=3D24) (actual time=3D0.145..0.176 =
rows=3D1 loops=3D490)"=0A=
"                          ->=3B  Ne=
sted Loop  (cost=3D0.00..635.50 rows=3D1 width=3D32) (actual time=3D0.099..=
0.125 rows=3D1 loops=3D490)"=0A=
"                                ->=
=3B  Nested Loop  (cost=3D0.00..624.53 rows=3D1 width=3D16) (actual time=3D=
0.096..0.107 rows=3D1 loops=3D490)"=0A=
"                                     =
 ->=3B  Nested Loop  (cost=3D0.00..602.15 rows=3D1 width=3D16) (actual ti=
me=3D0.059..0.069 rows=3D1 loops=3D490)"=
=0A=
"                                     =
       ->=3B  Index Scan using "ix_ino=
de_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=
"                                     =
       ->=3B  Index Scan using "pk_ino=
de_segments" on "inode_segments" "mv"  (c=
ost=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_seg=
ments_st_inos" on "inode_segments" "fd"  (c=
ost=3D0.00..21.86 rows=3D52 width=3D16) (actual time=3D0.050..0.051 rows=3D=
1 loops=3D355)"=0A=
"                                     =
       Index Cond: (("st_ino")::bigint =3D ("mv"."st_ino_target")::bigint)"<=
span class=3D"ecxpln" style=3D"padding:0px=3Bborder:0px=3Bfont-size:13px=3B=
color:rgb(0=2C 0=2C 0)=3B">=0A=
"                                ->=
=3B  Index Scan using "ix_inode_segmen=
ts_st_ino_targets" on "inode_segments" "<=
/span>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  In=
dex 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_in=
o")::bigint)"=0A=
"                                Filte=
r: ((("st_ino")::bigint =3D 2) OR ((B'00000000000000001111000000000000'::"bit" &=
amp=3B ("st_mode")::"bit") =3D B'00000000000000000100000000000000'::"bit"))"=
=0A=
"                    ->=3B  Index Sc=
an using "pk_inodes" on "inodes" "t<=
span class=3D"ecxstr" style=3D"padding:0px=3Bborder:0px=3Bfont-size:13px=3B=
color:rgb(128=2C 0=2C 0)=3B">"  (cost=3D0.00..6.24 rows=3D1 width=3D21) (ac=
tual time=3D0.039..0.040 rows=3D1 loops=3D355)"=0A=
"                          Index Cond:=
 (("st_ino")::bigint =3D ("p"."st_ino_target<=
/span>")::bigint)"=0A=
"              ->=3B  CTE Scan on "<=
/span>stat_h_with_bits" "sb"  (cost=3D519.00..519.63 rows=3D23 width=3D72) (actual tim=
e=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=3D68) (actual time=3D=
0.002..0.023 rows=3D23 loops=3D1)"=0A=
"                    CTE stat_h_with_b=
its"=0A=
"                      ->=3B  CTE Sc=
an 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 1=
2"=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_t=
o_table" "digits"  (cost=3D0.01..10.01 ro=
ws=3D1000 width=3D32) (actual time=3D0.007..0.008 rows=3D3 loops=3D23)"=0A=
"              SubPlan 3"=0A=
"                ->=3B  Aggregate  (=
cost=3D36.46..36.47 rows=3D1 width=3D47) (actual time=3D0.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 width=3D47) (actual time=3D0.039..0.040 rows=3D1 loops=3D355)"=
=0A=
"                            Index Con=
d: (("st_ino")::bigint =3D ("p"."st_ino_targ=
et")::bigint)"=0A=
"        SubPlan 1"=0A=
"          ->=3B  Aggregate  (cost=
=3D36.46..36.47 rows=3D1 width=3D47) (actual time=3D0.250..0.251 rows=3D1 l=
oops=3D500)"=0A=
"                ->=3B  Index Scan u=
sing "ix_inode_segments_st_inos" on "inode_=
segments" "fs"  (cost=3D0.00..36.33 row=
s=3D52 width=3D47) (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: 44702.582 ms"

BLOAT= :

scheman=
ame   tblname   idxname    real_size    bloat_size=0A=
gorfs  inode_segments    "ix_inode_seg=
ments_gsdi_pk"   4246921216     973275136=0A=
gorfs  inode_segments  "ix_inode_seg=
ments_ja_files_lookup" 184844288  59793408=0A=
gorfs  inode_segments  "ix_inode_seg=
ments_notes_clientids" 187555840  62504960=0A=
gorfs  inode_segments "ix_inode_segmen=
ts_notes_fileids"   247037952   121987072=0A=
gorfs  inode_segments "ix_inode_segmen=
ts_notes_noteids"   230473728   105422848
=
= --_8bce3c54-937f-4676-a46d-b0558782dc37_--