Well there isn't much we can say without knowing more about it such as the php code that runs in the main page that you're having problems with.
Also are you on a shared hosting package or do you hire a dedicated server / vps? - If you're on a shared machine it may not actually be your site at fault. It may well be that the mysql (database) server is being slowed down by another website that is accessing it (eg maybe someone has a badly coded website running multiple queries in a loop or it just gets a lot of visitors which also could weigh down the database server).
Either way, unless you can tell us more, there isn't much we can do to help!
My helpful sig has gone because a mod below the administrator gave me an infraction - despite the administrator personally agreeing to it.
If you need any php tips or tricks you can PM me.