QUERY PLAN
Aggregate (cost=11.34..11.35 rows=1 width=8)
-> Sort (cost=11.06..11.11 rows=19 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=19 width=532)
Filter: ((parent_id IS NULL) AND (ledger_id = 1) AND (type = '1'::smallint))