Thank you very much for your answer. As far as I remember in EJB 2.1 one could define database indexes in descriptor files. I'm not completely positive about that because maybe it was a vendor specific feature....
So you suggest that I should "manually" create indexes in my database?
Karol, It must have been a database specific feature as that was never in the EJB specification. It's possible your app server vendor still supports that.
When I said "manual", I meant command line. Scroll down to the section on indexes on the w3schools tutorial for the syntax. I recommend that route. It's not hard and it frees you from a vendor feature that may or may not be supported in the future. It also allows you to create the indexes even if you don't use EJB or J2EE in the future. Databases tend to outlive applications.
Thank you very much for your answer. I know how to make database indexes manually, I just thought it may be somehow integrated in EJB so that during any database schema change (what happens relatively often on early stages of developmen) I wouldn't have to add the indexes manually. I suppose I'll have to write the indexes creation in a separate script.