SELECT jsonb,id FROM fs09000000_mod_circulation_storage.loan WHERE lower(f_unaccent(loan.jsonb->'status'->>'name')) NOT LIKE lower(f_unaccent('Closed')) LIMIT 2147483647 OFFSET 0 Limit (cost=0.00..2037.66 rows=5132 width=896) (actual time=0.025..13.339 rows=5158 loops=1) -> Seq Scan on loan (cost=0.00..2037.66 rows=5132 width=896) (actual time=0.024..12.973 rows=5158 loops=1) Filter: (lower(f_unaccent(((jsonb -> 'status'::text) ->> 'name'::text))) !~~ 'closed'::text) Planning time: 0.128 ms; Execution time: 13.541 ms; SELECT count_estimate('SELECT jsonb,id FROM fs09000000_mod_circulation_storage.loan WHERE lower(f_unaccent(loan.jsonb->''status''->>''name'')) NOT LIKE lower(f_unaccent(''Closed''))') Result (cost=0.00..0.26 rows=1 width=8) (actual time=0.567..0.568 rows=1 loops=1) Planning time: 0.014 ms; Execution time: 0.579 ms; SELECT COUNT(*) FROM fs09000000_mod_circulation_storage.loan Aggregate (cost=170.55..170.56 rows=1 width=8) (actual time=5.458..5.458 rows=1 loops=1) -> Index Only Scan using loan_metadata_createdbyusername_idx on loan (cost=0.28..157.65 rows=5158 width=0) (actual time=4.669..5.167 rows=5158 loops=1) Heap Fetches: 0 Planning time: 0.071 ms; Execution time: 5.477 ms SELECT jsonb,id FROM fs09000000_mod_circulation_storage.loan LIMIT 2147483647 OFFSET 0 Limit (cost=0.00..696.58 rows=5158 width=896) (actual time=0.007..1.727 rows=5158 loops=1) -> Seq Scan on loan (cost=0.00..696.58 rows=5158 width=896) (actual time=0.006..1.376 rows=5158 loops=1) Planning time: 0.060 ms Execution time: 1.928 ms ======================================================================================================================== SELECT jsonb,id FROM fs09000000_mod_inventory_storage.item WHERE (id='0d1564c0-b9b4-43ef-9b4d-13fa58b3da72') OR (id='14aeefaf-553c-4875-9ee2-dd3337ad0bb9') LIMIT 2147483647 OFFSET 0 Limit (cost=9.14..17.16 rows=2 width=778) (actual time=3.689..3.691 rows=2 loops=1) -> Bitmap Heap Scan on item (cost=9.14..17.16 rows=2 width=778) (actual time=3.688..3.690 rows=2 loops=1) Recheck Cond: ((id = '0d1564c0-b9b4-43ef-9b4d-13fa58b3da72'::uuid) OR (id = '14aeefaf-553c-4875-9ee2-dd3337ad0bb9'::uuid)) Heap Blocks: exact=2 -> BitmapOr (cost=9.14..9.14 rows=2 width=0) (actual time=3.682..3.682 rows=0 loops=1) -> Bitmap Index Scan on item_pkey (cost=0.00..4.57 rows=1 width=0) (actual time=1.925..1.925 rows=1 loops=1) Index Cond: (id = '0d1564c0-b9b4-43ef-9b4d-13fa58b3da72'::uuid) -> Bitmap Index Scan on item_pkey (cost=0.00..4.57 rows=1 width=0) (actual time=1.756..1.756 rows=1 loops=1) Index Cond: (id = '14aeefaf-553c-4875-9ee2-dd3337ad0bb9'::uuid) Planning time: 1.267 ms; Execution time: 3.712 ms SELECT count_estimate('SELECT jsonb,id FROM fs09000000_mod_inventory_storage.item WHERE (id=''0d1564c0-b9b4-43ef-9b4d-13fa58b3da72'') OR (id=''14aeefaf-553c-4875-9ee2-dd3337ad0bb9'')') Result (cost=0.00..0.26 rows=1 width=8) (actual time=0.830..0.830 rows=1 loops=1) Planning time: 0.014 ms; Execution time: 0.841 ms ========================================================================================================================= SELECT count_estimate('SELECT * FROM fs09000000_mod_feesfines.accounts WHERE (lower(f_unaccent(accounts.jsonb->>''loanId'')) LIKE lower(f_unaccent(''7c62dc6e-7691-4f17-b9de-0c0cb82df686''))) OR (lower(f_unaccent(accounts.jsonb->>''loanId'')) LIKE lower(f_unaccent(''381500ab-2987-4908-859c-d71b53fefd2e'')))') Result (cost=0.00..0.26 rows=1 width=8) (actual time=0.562..0.562 rows=1 loops=1) Planning time: 0.013 ms; Execution time: 0.573 ms; SELECT SELECT * FROM fs09000000_mod_feesfines.accounts WHERE (lower(f_unaccent(accounts.jsonb->>'loanId')) LIKE lower(f_unaccent('7c62dc6e-7691-4f17-b9de-0c0cb82df686'))) OR (lower(f_unaccent(accounts.jsonb->>'loanId')) LIKE lower(f_unaccent('381500ab-2987-4908-859c-d71b53fefd2e'))) Seq Scan on accounts (cost=0.00..377.50 rows=7 width=88) (actual time=0.078..0.078 rows=0 loops=1) Rows Removed by Filter: 10 Planning time: 0.133 ms Execution time: 0.090 ms