Tom said:
> datatype mismatch that prevents the index from being used. What are the
> datatypes of d.batchid and b.batchid, exactly? If they're not the same,
> either make them the same or add an explicit coercion to the query, like
> WHERE d.batchid = b.batchid::typeof_d_batchid
>
It can be source of problem. I found in one of Roman's mail, that
batchid is declared as int8 in master table and as int4 in detail table.
Regards,
Tomasz Myrta