A semantics-driven query optimizer for OODBs