make join/from order-independent, use built-in functions if available