Search for nested values in jsonb array with greater operator
This is generally hard to optimize: no direct operator or index support for jsonb for this kind of test.

EXISTS should at least be faster than what you have, while also avoiding duplicate rows (where multiple array elements match) and the additional (redundant) column pil in the result:

SELECT *
FROM   documents d
WHERE  EXISTS (
   SELECT FROM jsonb_array_elements(d.data_block -&gt; 'PAYABLE_INVOICE_LINES') pil 
   WHERE (pil-&gt;'AMOUNT'-&gt;&gt;'value')::decimal &gt; 1000
   );


Related:


Indexed range comparison of array key&#39;s value in row inside JSONB
Speed up range test for key values nested in jsonb array of objects


To make this faster by orders of magnitude, extract the maximum value per row and save it redundantly or use an IMMUTABLE function in a very small and fast (but also specialized) expression index:

CREATE OR REPLACE FUNCTION f_doc_max_amout(jsonb)
  RETURNS numeric AS
$func$
   SELECT max((a-&gt;'AMOUNT'-&gt;&gt;'value')::numeric)
   FROM   jsonb_array_elements($1) a
$func$ LANGUAGE sql IMMUTABLE;

CREATE INDEX documents_max_amount_idx
ON documents (f_doc_max_amout(data_block -&gt; 'PAYABLE_INVOICE_LINES')); 


Query (must match index expression):

SELECT *
FROM   documents d
WHERE  f_doc_max_amout(data_block -&gt; 'PAYABLE_INVOICE_LINES') &gt; 1000;


dbfiddle here