Now === postgres=# explain analyze select * from obce join okresy on obce.okres_id = okresy.id where okresy.nazev = 'Benešov'; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------- Nested Loop (cost=0.28..15.19 rows=81 width=58) (actual time=0.067..0.246 rows=114 loops=1) -> Seq Scan on okresy (cost=0.00..1.96 rows=1 width=17) (actual time=0.025..0.053 rows=1 loops=1) Filter: (nazev = 'Benešov'::text) Rows Removed by Filter: 76 -> Index Scan using obce_okres_id_idx on obce (cost=0.28..12.41 rows=81 width=41) (actual time=0.032..0.116 rows=114 loops=1) Index Cond: ((okres_id)::text = okresy.id) Planning time: 0.940 ms Execution time: 0.359 ms (8 rows) Alternative =========== postgres=# explain analyze select * from obce join okresy on obce.okres_id = okresy.id where okresy.nazev = 'Benešov'; QUERY PLAN ------------------------------------------------------------------------------------------------ Nested Loop (cost=0.28..15.19 rows=81 width=58) (actual time=0.067..0.246 rows=114 loops=1) -> Seq Scan on okresy (cost=0.00..1.96 rows=1 width=17) (actual time=0.025..0.053 rows=1 loops=1) Filter: (nazev = 'Benešov'::text) Rows Removed by Filter: 76 -> Index Scan using obce_okres_id_idx on obce (cost=0.28..12.41 rows=81 width=41) (actual time=0.032..0.116 rows=114 loops=1) Index Cond: ((okres_id)::text = okresy.id) Planning time: 0.940 ms Execution time: 0.359 ms (8 rows)