Assuming I have a querying returning a bunch of IDs back.
How would I go with fetching each such ID from the same table or another table in parallel?
Sometimes fetching by ID in parallel from client side, is faster and less memory consuming than the extra join / IN predicate.
If we could define some sort of a TVF that works on a scalar and returns a ROW it would run in parallel?
CREATE FUNCTION my_func_to_fetch_by_id (a varchar)
returns table/row/row(s) as return select * from another_table where some_id=a;
i.e.: select my_func_to_fetch_by_id(my_id) from ( select my_id from big_table order by something desc limit 100);
the other alternative is to query in parallel after fetching the result set, which incurs an overhead.