QUERY PLAN
Aggregate (cost=11.39..11.40 rows=1 width=8)
-> Sort (cost=11.09..11.14 rows=20 width=532)
Sort Key: tbl_ledger_account_captions.serial_no, tbl_ledger_account_captions.id
-> Seq Scan on tbl_ledger_account_captions (cost=0.00..10.65 rows=20 width=532)
Filter: ((parent_id IS NULL) AND (ledger_id = 1) AND (type = '6'::smallint))