Increasing data volume in the database of organizations especially those that are multicluster and geographically extensive cause a lot of problems in data storage, retrieve and transmition. In addition, data integration related to database existed in different geographical positions is too risky with the respect of security and velocity of transaction executing and generally posses some disadvantages which can be solved by using the grid database and leads to more efficient function. Therefore, with internet extension among the organizations and institutes and also accordance of grid architecture to it, development of database in grid environments is inevitable. In order to establish a structure for data storing in the width of a grid environment in distributed and heterogonous from tries to storage and distribute data in a wide geographical region. Because of extension and high volume of data, transaction processing in such an environment is complexity and time-consuming. It is obvious that if non-optimal queries are used, transaction efficiency in this database will considerably be decreased. But if appropriate optimal algorithms are used, this efficiency will be so much increased. There are a lot of algorithms suggested for optimization of queries. However, due to difference of grid environments, different optimal algorithms are required. In this study presented algorithm is according to the structure of grid measurement and through a novel solving performs a good function in high data volume grid base systems.