Hello Ladi Tanooja,
By using retrieve by association, you will able to retrieve all the data associated with a specific object in the entity. However it will take time to retrieve the associated data because it has to go through both the parent and child entity.
I always suggest, to use retrieve from database and filter it using xpath. By this way you can see some improved performance.
For more detail on this, you can check the academy path: https://academy.mendix.com/link/paths/106/Advanced-Domain-Model-Skills
Hope my answer helps.