Optimization of Join-Type Queries in Nested Relational Databases