Dear Hackers,

I've come across a behaviour of the planner I can't explain.
After a migration from 11 to 15 (on RDS) we noticed a degradation in response time on a query, it went from a few seconds to ten minutes.
A vacuum(analyze) has been realized to be sure that all is clean.
The 'explain analyze' shows us a change of plan. Postgresql 15 chooses `incremental sort` with an index corresponding to the ORDER BY clause (on the created_at column). The previous v11 plan used a more efficient index.

By deactivating incremental sort, response times in v15 are equal to v11 one.

Here is the query

    SELECT inputdocum0_.id AS col_0_0_
    FROM document_management_services.input_document inputdocum0_
    WHERE (inputdocum0_.indexation_domain_id in ('2d29daf6-e151-479a-a52a-78b08bb3009d'))       AND (inputdocum0_.indexation_subsidiary_id in ('9f9df402-f70b-40d9-b283-a3c35232469a'))
      AND (inputdocum0_.locked_at IS NULL)
      AND (inputdocum0_.locked_by_app IS NULL)
      AND (inputdocum0_.locked_by_user IS NULL)
      AND (inputdocum0_.lock_time_out IS NULL)
      AND inputdocum0_.archiving_state<> 'DESTROYED'
      AND (inputdocum0_.creation_state in ('READY'))
      AND inputdocum0_.active_content=true
      AND (inputdocum0_.processing_state in ('PENDING_INDEXATION'))
    ORDER BY inputdocum0_.created_at ASC,
             inputdocum0_.reception_id ASC,
             inputdocum0_.reception_order ASC
    LIMIT 50 ;

Here are some details, the table `input_document` is partionned by hash with 20 partitions  with a lot of indexes

Indexes:
    "input_document_pkey" PRIMARY KEY, btree (id)
    "input_document_api_version_idx" btree (api_version) INVALID
    "input_document_created_at_idx" btree (created_at)
    "input_document_created_by_user_profile_idx" btree (created_by_user_profile)     "input_document_dashboard_idx" btree (processing_state, indexation_family_id, indexation_group_id, reception_id) INCLUDE (active_content, archiving_state, creation_state) WHERE active_content = true AND archiving_state <> 'DESTROYED'::text AND creation_state <> 'PENDING'::text     "input_document_fts_description_idx" gin (to_tsvector('simple'::regconfig, description))     "input_document_fts_insured_firstname_idx" gin (to_tsvector('simple'::regconfig, indexation_insured_firstname))     "input_document_fts_insured_lastname_idx" gin (to_tsvector('simple'::regconfig, indexation_insured_lastname))     "input_document_indexation_activity_id_idx" btree (indexation_activity_id)
    "input_document_indexation_agency_id_idx" btree (indexation_agency_id)
    "input_document_indexation_distributor_id_idx" btree (indexation_distributor_id)
    "input_document_indexation_domain_id_idx" btree (indexation_domain_id)
    "input_document_indexation_family_id_idx" btree (indexation_family_id)
    "input_document_indexation_group_id_idx" btree (indexation_group_id)
    "input_document_indexation_insurer_id_idx" btree (indexation_insurer_id)
    "input_document_indexation_nature_id_idx" btree (indexation_nature_id)
    "input_document_indexation_reference_idx" btree (indexation_reference)
    "input_document_indexation_subsidiary_id_idx" btree (indexation_subsidiary_id)     "input_document_indexation_warranty_id_idx" btree (indexation_warranty_id)
    "input_document_locked_by_user_idx" btree (locked_by_user)
    "input_document_modified_at_idx" btree (modified_at)
    "input_document_modified_by_user_profile_idx" btree (modified_by_user_profile)
    "input_document_processing_state_idx" btree (processing_state)
    "input_document_stock_idx" btree (active_content, archiving_state, creation_state, processing_state) WHERE active_content AND archiving_state <> 'DESTROYED'::text AND creation_state <> 'PENDING'::text AND (processing_state = ANY ('{PENDING_PROCESSING,PENDING_INDEXATION,READY}'::text[]))     "input_dom_act_pi_idx" btree (indexation_activity_id, indexation_domain_id) WHERE processing_state = 'PENDING_INDEXATION'::text     "input_dom_act_pp_idx" btree (indexation_activity_id, indexation_domain_id) WHERE processing_state = 'PENDING_PROCESSING'::text     "input_dom_act_sub_idx" btree (indexation_activity_id, indexation_domain_id, indexation_subsidiary_id)
    "input_reception_id_created_at_idx" btree (reception_id, created_at)
    "input_reception_id_reception_order_idx" btree (reception_id, reception_order)     "operational_perimeter_view_idx" btree (processing_state, indexation_distributor_id) WHERE processing_state = 'PENDING_PROCESSING'::text

Please find attached the 3 plans

explain_analyse_incremental_off.txt with enable_incremental_sort to off
explain_analyse_incremental_on.txt with enable_incremental_sort to on
explain_analyse_incremental_on_limit5000 with enable_incremental_sort to on but with increase the limit to 5000, in this case plan choose don't use `Incremental Sort`

The point that I don't understand in the plan (incremental_sort to on) is the top level one, the limit cost doesn't seem right.

Limit  (cost=324.05..16073.82 rows=50 width=44) (actual time=1663688.290..1663696.151 rows=50 loops=1)
   Buffers: shared hit=114672881 read=5725197 dirtied=38564 written=24394
   I/O Timings: shared/local read=1481378.069 write=313.574
   ->  Incremental Sort  (cost=324.05..27838050.13 rows=88375 width=44) (actual time=1663688.289..1663696.144 rows=50 loops=1)


Have you a explaination on the behaviour ?

Best regards


--
Nicolas Lutic
                                                                                
                                                                       QUERY 
PLAN                                                                            
                                                                            
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=262056.35..262056.47 rows=50 width=44) (actual 
time=190.836..190.859 rows=50 loops=1)
   Buffers: shared hit=165374 dirtied=1
   ->  Sort  (cost=262056.35..262277.28 rows=88375 width=44) (actual 
time=190.835..190.848 rows=50 loops=1)
         Sort Key: inputdocum0_.created_at, inputdocum0_.reception_id, 
inputdocum0_.reception_order
         Sort Method: top-N heapsort  Memory: 31kB
         Buffers: shared hit=165374 dirtied=1
         ->  Append  (cost=0.29..259120.59 rows=88375 width=44) (actual 
time=5.260..190.514 rows=1078 loops=1)
               Buffers: shared hit=165374 dirtied=1
               ->  Index Scan using 
input_document_00_indexation_activity_id_indexation_domain_idx1 on 
input_document_00 inputdocum0__1  (cost=0.29..12844.44 rows=4386 width=44) 
(actual time=5.259..9.211 rows=56 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 6931
                     Buffers: shared hit=7989
               ->  Index Scan using 
input_document_01_indexation_activity_id_indexation_domain_idx1 on 
input_document_01 inputdocum0__2  (cost=0.29..12873.65 rows=4352 width=44) 
(actual time=5.529..9.709 rows=53 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 7025
                     Buffers: shared hit=8372
               ->  Index Scan using 
input_document_02_indexation_activity_id_indexation_domain_idx1 on 
input_document_02 inputdocum0__3  (cost=0.29..12761.21 rows=4380 width=44) 
(actual time=6.005..9.832 rows=59 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 7053
                     Buffers: shared hit=8275
               ->  Index Scan using 
input_document_03_indexation_activity_id_indexation_domain_idx1 on 
input_document_03 inputdocum0__4  (cost=0.29..13019.24 rows=4467 width=44) 
(actual time=5.382..9.862 rows=60 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 7015
                     Buffers: shared hit=8289
               ->  Index Scan using 
input_document_04_indexation_activity_id_indexation_domain_idx1 on 
input_document_04 inputdocum0__5  (cost=0.29..12800.57 rows=4353 width=44) 
(actual time=3.896..9.561 rows=50 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 7102
                     Buffers: shared hit=8182
               ->  Index Scan using 
input_document_05_indexation_activity_id_indexation_domain_idx1 on 
input_document_05 inputdocum0__6  (cost=0.29..13551.07 rows=4600 width=44) 
(actual time=5.455..9.603 rows=71 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 6984
                     Buffers: shared hit=8234
               ->  Index Scan using 
input_document_06_indexation_activity_id_indexation_domain_idx1 on 
input_document_06 inputdocum0__7  (cost=0.29..12792.32 rows=4349 width=44) 
(actual time=5.303..10.089 rows=55 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 7028
                     Buffers: shared hit=8382
               ->  Index Scan using 
input_document_07_indexation_activity_id_indexation_domain_idx1 on 
input_document_07 inputdocum0__8  (cost=0.29..13524.32 rows=4590 width=44) 
(actual time=4.964..9.803 rows=55 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 7072
                     Buffers: shared hit=8556
               ->  Index Scan using 
input_document_08_indexation_activity_id_indexation_domain_idx1 on 
input_document_08 inputdocum0__9  (cost=0.29..13222.97 rows=4531 width=44) 
(actual time=6.374..10.024 rows=49 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 7203
                     Buffers: shared hit=8409
               ->  Index Scan using 
input_document_09_indexation_activity_id_indexation_domain_idx1 on 
input_document_09 inputdocum0__10  (cost=0.29..12945.35 rows=4399 width=44) 
(actual time=5.608..9.712 rows=43 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 7042
                     Buffers: shared hit=8186
               ->  Index Scan using 
input_document_10_indexation_activity_id_indexation_domain_idx1 on 
input_document_10 inputdocum0__11  (cost=0.29..13146.21 rows=4451 width=44) 
(actual time=4.734..9.246 rows=51 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 6997
                     Buffers: shared hit=8136
               ->  Index Scan using 
input_document_11_indexation_activity_id_indexation_domain_idx1 on 
input_document_11 inputdocum0__12  (cost=0.29..12324.47 rows=4178 width=44) 
(actual time=5.053..9.310 rows=57 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 6989
                     Buffers: shared hit=8134
               ->  Index Scan using 
input_document_12_indexation_activity_id_indexation_domain_idx1 on 
input_document_12 inputdocum0__13  (cost=0.29..13506.89 rows=4569 width=44) 
(actual time=5.539..8.605 rows=57 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 7026
                     Buffers: shared hit=8418
               ->  Index Scan using 
input_document_13_indexation_activity_id_indexation_domain_idx1 on 
input_document_13 inputdocum0__14  (cost=0.29..13398.08 rows=4537 width=44) 
(actual time=6.058..9.401 rows=64 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 6979
                     Buffers: shared hit=8281 dirtied=1
               ->  Index Scan using 
input_document_14_indexation_activity_id_indexation_domain_idx1 on 
input_document_14 inputdocum0__15  (cost=0.29..12748.84 rows=4391 width=44) 
(actual time=6.587..8.968 rows=60 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 6958
                     Buffers: shared hit=8274
               ->  Index Scan using 
input_document_15_indexation_activity_id_indexation_domain_idx1 on 
input_document_15 inputdocum0__16  (cost=0.29..12835.44 rows=4434 width=44) 
(actual time=5.711..9.774 rows=54 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 6957
                     Buffers: shared hit=8236
               ->  Index Scan using 
input_document_16_indexation_activity_id_indexation_domain_idx1 on 
input_document_16 inputdocum0__17  (cost=0.29..12660.13 rows=4373 width=44) 
(actual time=7.794..11.250 rows=45 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 6985
                     Buffers: shared hit=8279
               ->  Index Scan using 
input_document_17_indexation_activity_id_indexation_domain_idx1 on 
input_document_17 inputdocum0__18  (cost=0.29..13197.34 rows=4540 width=44) 
(actual time=5.942..8.533 rows=51 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 7086
                     Buffers: shared hit=8439
               ->  Index Scan using 
input_document_18_indexation_activity_id_indexation_domain_idx1 on 
input_document_18 inputdocum0__19  (cost=0.29..11642.48 rows=4029 width=44) 
(actual time=6.790..9.283 rows=44 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 7026
                     Buffers: shared hit=8138
               ->  Index Scan using 
input_document_19_indexation_activity_id_indexation_domain_idx1 on 
input_document_19 inputdocum0__20  (cost=0.29..12883.71 rows=4466 width=44) 
(actual time=5.687..8.579 rows=44 loops=1)
                     Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text))
                     Rows Removed by Filter: 7064
                     Buffers: shared hit=8165
 Planning Time: 6.280 ms
 Execution Time: 191.048 ms
(110 rows)

                                                                                
                                                                                
                                                      QUERY PLAN                
                                                                                
                                                                                
                                       
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=324.05..16073.82 rows=50 width=44) (actual 
time=1663688.290..1663696.151 rows=50 loops=1)
   Buffers: shared hit=114672881 read=5725197 dirtied=38564 written=24394
   I/O Timings: shared/local read=1481378.069 write=313.574
   ->  Incremental Sort  (cost=324.05..27838050.13 rows=88375 width=44) (actual 
time=1663688.289..1663696.144 rows=50 loops=1)
         Sort Key: inputdocum0_.created_at, inputdocum0_.reception_id, 
inputdocum0_.reception_order
         Presorted Key: inputdocum0_.created_at
         Full-sort Groups: 2  Sort Method: quicksort  Average Memory: 27kB  
Peak Memory: 27kB
         Buffers: shared hit=114672881 read=5725197 dirtied=38564 written=24394
         I/O Timings: shared/local read=1481378.069 write=313.574
         ->  Merge Append  (cost=9.08..27834073.25 rows=88375 width=44) (actual 
time=1663655.490..1663696.068 rows=53 loops=1)
               Sort Key: inputdocum0_.created_at
               Buffers: shared hit=114672878 read=5725197 dirtied=38564 
written=24394
               I/O Timings: shared/local read=1481378.069 write=313.574
               ->  Index Scan using input_document_00_created_at_idx on 
input_document_00 inputdocum0__1  (cost=0.43..1393473.44 rows=4386 width=44) 
(actual time=71549.638..71550.023 rows=4 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6142526
                     Buffers: shared hit=5765368 read=249016 dirtied=1845
                     I/O Timings: shared/local read=63290.786
               ->  Index Scan using input_document_01_created_at_idx on 
input_document_01 inputdocum0__2  (cost=0.43..1393184.39 rows=4352 width=44) 
(actual time=78042.848..78045.976 rows=2 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6143127
                     Buffers: shared hit=5738497 read=284482 dirtied=1962
                     I/O Timings: shared/local read=69615.236
               ->  Index Scan using input_document_02_created_at_idx on 
input_document_02 inputdocum0__3  (cost=0.43..1392610.99 rows=4380 width=44) 
(actual time=81013.719..81015.228 rows=5 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6142365
                     Buffers: shared hit=5724544 read=289987 dirtied=1815
                     I/O Timings: shared/local read=72137.057
               ->  Index Scan using input_document_03_created_at_idx on 
input_document_03 inputdocum0__4  (cost=0.43..1393923.23 rows=4467 width=44) 
(actual time=199595.759..199598.812 rows=2 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6146675
                     Buffers: shared hit=5543097 read=475116 dirtied=1981 
written=813
                     I/O Timings: shared/local read=189813.632 write=34.866
               ->  Index Scan using input_document_04_created_at_idx on 
input_document_04 inputdocum0__5  (cost=0.43..1397122.98 rows=4353 width=44) 
(actual time=82145.692..82146.951 rows=6 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6147554
                     Buffers: shared hit=5719152 read=304006 dirtied=1920
                     I/O Timings: shared/local read=73345.926
               ->  Index Scan using input_document_05_created_at_idx on 
input_document_05 inputdocum0__6  (cost=0.43..1388617.40 rows=4600 width=44) 
(actual time=82586.906..82587.807 rows=4 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6141686
                     Buffers: shared hit=5711928 read=301639 dirtied=1898
                     I/O Timings: shared/local read=74137.666
               ->  Index Scan using input_document_06_created_at_idx on 
input_document_06 inputdocum0__7  (cost=0.43..1390531.29 rows=4349 width=44) 
(actual time=63089.152..63090.770 rows=3 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6145079
                     Buffers: shared hit=5779774 read=241619 dirtied=1922
                     I/O Timings: shared/local read=54763.294
               ->  Index Scan using input_document_07_created_at_idx on 
input_document_07 inputdocum0__8  (cost=0.43..1390230.46 rows=4590 width=44) 
(actual time=81109.357..81110.828 rows=3 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6142853
                     Buffers: shared hit=5749729 read=277663 dirtied=1941
                     I/O Timings: shared/local read=72473.615
               ->  Index Scan using input_document_08_created_at_idx on 
input_document_08 inputdocum0__9  (cost=0.43..1391099.15 rows=4531 width=44) 
(actual time=74895.899..74897.421 rows=6 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6144254
                     Buffers: shared hit=5777691 read=241200 dirtied=1950
                     I/O Timings: shared/local read=65971.028
               ->  Index Scan using input_document_09_created_at_idx on 
input_document_09 inputdocum0__10  (cost=0.43..1392014.47 rows=4399 width=44) 
(actual time=69633.668..69655.958 rows=5 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6142825
                     Buffers: shared hit=5773052 read=242699 dirtied=1841
                     I/O Timings: shared/local read=60391.646
               ->  Index Scan using input_document_10_created_at_idx on 
input_document_10 inputdocum0__11  (cost=0.43..1390727.36 rows=4451 width=44) 
(actual time=79189.038..79189.118 rows=4 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6140756
                     Buffers: shared hit=5758549 read=255973 dirtied=1845
                     I/O Timings: shared/local read=70141.546
               ->  Index Scan using input_document_11_created_at_idx on 
input_document_11 inputdocum0__12  (cost=0.43..1392159.62 rows=4178 width=44) 
(actual time=81230.619..81231.149 rows=6 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6143392
                     Buffers: shared hit=5718755 read=294731 dirtied=1956
                     I/O Timings: shared/local read=72242.944
               ->  Index Scan using input_document_12_created_at_idx on 
input_document_12 inputdocum0__13  (cost=0.43..1389085.03 rows=4569 width=44) 
(actual time=80568.728..80568.743 rows=3 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6142009
                     Buffers: shared hit=5729875 read=297063 dirtied=1901 
written=23581
                     I/O Timings: shared/local read=71003.146 write=278.708
               ->  Index Scan using input_document_13_created_at_idx on 
input_document_13 inputdocum0__14  (cost=0.43..1390915.23 rows=4537 width=44) 
(actual time=92845.510..92845.536 rows=2 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6140388
                     Buffers: shared hit=5718123 read=294846 dirtied=1978
                     I/O Timings: shared/local read=82457.429
               ->  Index Scan using input_document_14_created_at_idx on 
input_document_14 inputdocum0__15  (cost=0.43..1390496.37 rows=4391 width=44) 
(actual time=76680.146..76680.493 rows=3 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6145213
                     Buffers: shared hit=5730831 read=292745 dirtied=1938
                     I/O Timings: shared/local read=67345.796
               ->  Index Scan using input_document_15_created_at_idx on 
input_document_15 inputdocum0__16  (cost=0.43..1389344.68 rows=4434 width=44) 
(actual time=79121.128..79121.128 rows=1 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6142544
                     Buffers: shared hit=5736153 read=287998 dirtied=1944
                     I/O Timings: shared/local read=69545.597
               ->  Index Scan using input_document_16_created_at_idx on 
input_document_16 inputdocum0__17  (cost=0.43..1391248.91 rows=4373 width=44) 
(actual time=50357.406..50357.748 rows=4 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6143612
                     Buffers: shared hit=5783032 read=241665 dirtied=1998
                     I/O Timings: shared/local read=40910.123
               ->  Index Scan using input_document_17_created_at_idx on 
input_document_17 inputdocum0__18  (cost=0.43..1390490.21 rows=4540 width=44) 
(actual time=77469.969..77470.333 rows=3 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6144228
                     Buffers: shared hit=5747329 read=278125 dirtied=1988
                     I/O Timings: shared/local read=68235.691
               ->  Index Scan using input_document_18_created_at_idx on 
input_document_18 inputdocum0__19  (cost=0.43..1391527.45 rows=4029 width=44) 
(actual time=77176.667..77176.667 rows=1 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6144211
                     Buffers: shared hit=5745648 read=276205 dirtied=1989
                     I/O Timings: shared/local read=67795.868
               ->  Index Scan using input_document_19_created_at_idx on 
input_document_19 inputdocum0__20  (cost=0.43..1392918.55 rows=4466 width=44) 
(actual time=85353.600..85355.291 rows=5 loops=1)
                     Filter: ((locked_at IS NULL) AND (locked_by_app IS NULL) 
AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND active_content AND 
(archiving_state <> 'DESTROYED'::text) AND (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid) AND (indexation_subsidiary_id = 
'9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND (creation_state = 
'READY'::text) AND (processing_state = 'PENDING_INDEXATION'::text))
                     Rows Removed by Filter: 6143200
                     Buffers: shared hit=5721751 read=298419 dirtied=1952
                     I/O Timings: shared/local read=75760.042
 Planning:
   Buffers: shared hit=7
 Planning Time: 8.371 ms
 Execution Time: 1663700.900 ms
(117 rows)

                                                                                
                                                                          QUERY 
PLAN                                                                            
                                                                               
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=261429.93..262013.30 rows=5000 width=44) (actual 
time=73.216..73.989 rows=1232 loops=1)
   Buffers: shared hit=166387 dirtied=7
   ->  Gather Merge  (cost=261429.93..270022.79 rows=73648 width=44) (actual 
time=73.215..73.811 rows=1232 loops=1)
         Workers Planned: 2
         Workers Launched: 2
         Buffers: shared hit=166387 dirtied=7
         ->  Sort  (cost=260429.90..260521.96 rows=36824 width=44) (actual 
time=67.477..67.513 rows=411 loops=3)
               Sort Key: inputdocum0_.created_at, inputdocum0_.reception_id, 
inputdocum0_.reception_order
               Sort Method: quicksort  Memory: 55kB
               Buffers: shared hit=166387 dirtied=7
               Worker 0:  Sort Method: quicksort  Memory: 60kB
               Worker 1:  Sort Method: quicksort  Memory: 55kB
               ->  Parallel Append  (cost=0.29..257983.37 rows=36824 width=44) 
(actual time=6.110..67.258 rows=411 loops=3)
                     Buffers: shared hit=166337 dirtied=7
                     ->  Parallel Index Scan using 
input_document_05_indexation_activity_id_indexation_domain_idx1 on 
input_document_05 inputdocum0__6  (cost=0.29..13505.31 rows=2706 width=44) 
(actual time=4.474..8.040 rows=75 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 6984
                           Buffers: shared hit=8282
                     ->  Parallel Index Scan using 
input_document_07_indexation_activity_id_indexation_domain_idx1 on 
input_document_07 inputdocum0__8  (cost=0.29..13478.67 rows=2700 width=44) 
(actual time=5.316..11.536 rows=61 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 7071
                           Buffers: shared hit=8609 dirtied=1
                     ->  Parallel Index Scan using 
input_document_12_indexation_activity_id_indexation_domain_idx1 on 
input_document_12 inputdocum0__13  (cost=0.29..13461.40 rows=2688 width=44) 
(actual time=5.428..8.240 rows=61 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 7026
                           Buffers: shared hit=8476
                     ->  Parallel Index Scan using 
input_document_13_indexation_activity_id_indexation_domain_idx1 on 
input_document_13 inputdocum0__14  (cost=0.29..13352.92 rows=2669 width=44) 
(actual time=6.148..10.358 rows=72 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 6976
                           Buffers: shared hit=8321
                     ->  Parallel Index Scan using 
input_document_08_indexation_activity_id_indexation_domain_idx1 on 
input_document_08 inputdocum0__9  (cost=0.29..13177.96 rows=2665 width=44) 
(actual time=5.123..8.169 rows=66 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 7205
                           Buffers: shared hit=8460
                     ->  Parallel Index Scan using 
input_document_17_indexation_activity_id_indexation_domain_idx1 on 
input_document_17 inputdocum0__18  (cost=0.29..13152.15 rows=2671 width=44) 
(actual time=7.992..10.967 rows=63 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 7084
                           Buffers: shared hit=8503
                     ->  Parallel Index Scan using 
input_document_10_indexation_activity_id_indexation_domain_idx1 on 
input_document_10 inputdocum0__11  (cost=0.29..13101.85 rows=2618 width=44) 
(actual time=4.224..8.156 rows=63 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 6995
                           Buffers: shared hit=8173
                     ->  Parallel Index Scan using 
input_document_03_indexation_activity_id_indexation_domain_idx1 on 
input_document_03 inputdocum0__4  (cost=0.29..12974.79 rows=2628 width=44) 
(actual time=4.992..8.954 rows=61 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 7014
                           Buffers: shared hit=8336
                     ->  Parallel Index Scan using 
input_document_09_indexation_activity_id_indexation_domain_idx1 on 
input_document_09 inputdocum0__10  (cost=0.29..12901.62 rows=2588 width=44) 
(actual time=6.168..10.321 rows=61 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 7037
                           Buffers: shared hit=8228
                     ->  Parallel Index Scan using 
input_document_19_indexation_activity_id_indexation_domain_idx1 on 
input_document_19 inputdocum0__20  (cost=0.29..12839.26 rows=2627 width=44) 
(actual time=6.840..9.910 rows=54 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 7062
                           Buffers: shared hit=8208
                     ->  Parallel Index Scan using 
input_document_01_indexation_activity_id_indexation_domain_idx1 on 
input_document_01 inputdocum0__2  (cost=0.29..12830.23 rows=2560 width=44) 
(actual time=6.010..11.036 rows=61 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 7027
                           Buffers: shared hit=8439 dirtied=1
                     ->  Parallel Index Scan using 
input_document_00_indexation_activity_id_indexation_domain_idx1 on 
input_document_00 inputdocum0__1  (cost=0.29..12800.79 rows=2580 width=44) 
(actual time=5.043..9.051 rows=49 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 6927
                           Buffers: shared hit=8011
                     ->  Parallel Index Scan using 
input_document_15_indexation_activity_id_indexation_domain_idx1 on 
input_document_15 inputdocum0__16  (cost=0.29..12791.22 rows=2608 width=44) 
(actual time=3.162..5.227 rows=36 loops=2)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 3478
                           Buffers: shared hit=8305
                     ->  Parallel Index Scan using 
input_document_04_indexation_activity_id_indexation_domain_idx1 on 
input_document_04 inputdocum0__5  (cost=0.29..12757.31 rows=2561 width=44) 
(actual time=1.986..5.141 rows=30 loops=2)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 3550
                           Buffers: shared hit=8211 dirtied=1
                     ->  Parallel Index Scan using 
input_document_06_indexation_activity_id_indexation_domain_idx1 on 
input_document_06 inputdocum0__7  (cost=0.29..12749.00 rows=2558 width=44) 
(actual time=5.223..10.879 rows=60 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 7031
                           Buffers: shared hit=8431 dirtied=1
                     ->  Parallel Index Scan using 
input_document_02_indexation_activity_id_indexation_domain_idx1 on 
input_document_02 inputdocum0__3  (cost=0.29..12717.71 rows=2576 width=44) 
(actual time=6.613..11.165 rows=61 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 7053
                           Buffers: shared hit=8304 dirtied=1
                     ->  Parallel Index Scan using 
input_document_14_indexation_activity_id_indexation_domain_idx1 on 
input_document_14 inputdocum0__15  (cost=0.29..12705.16 rows=2583 width=44) 
(actual time=7.499..10.569 rows=54 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 6956
                           Buffers: shared hit=8306
                     ->  Parallel Index Scan using 
input_document_16_indexation_activity_id_indexation_domain_idx1 on 
input_document_16 inputdocum0__17  (cost=0.29..12616.55 rows=2572 width=44) 
(actual time=6.924..10.732 rows=54 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 6985
                           Buffers: shared hit=8340
                     ->  Parallel Index Scan using 
input_document_11_indexation_activity_id_indexation_domain_idx1 on 
input_document_11 inputdocum0__12  (cost=0.29..12282.94 rows=2458 width=44) 
(actual time=5.599..10.892 rows=63 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 6983
                           Buffers: shared hit=8172 dirtied=1
                     ->  Parallel Index Scan using 
input_document_18_indexation_activity_id_indexation_domain_idx1 on 
input_document_18 inputdocum0__19  (cost=0.29..11602.43 rows=2370 width=44) 
(actual time=8.538..11.839 rows=61 loops=1)
                           Index Cond: (indexation_domain_id = 
'2d29daf6-e151-479a-a52a-78b08bb3009d'::uuid)
                           Filter: ((locked_at IS NULL) AND (locked_by_app IS 
NULL) AND (locked_by_user IS NULL) AND (lock_time_out IS NULL) AND 
active_content AND (archiving_state <> 'DESTROYED'::text) AND 
(indexation_subsidiary_id = '9f9df402-f70b-40d9-b283-a3c35232469a'::uuid) AND 
(creation_state = 'READY'::text))
                           Rows Removed by Filter: 7024
                           Buffers: shared hit=8222 dirtied=1
 Planning Time: 5.769 ms
 Execution Time: 74.293 ms
(116 rows)

Reply via email to