Histogram is a kind of important tool in data query. Cost estimation needed in query operation of database varies in methods, in which histogram is that is most convenient for use and maintenance. Histogram categorizes and sets barrels to all tuples in the relations, calculates the size respectively for each barrel, and then summarizes, thus making the price statistics closer to the real value. In application of the actual program, this research works out methods that convert the connection of the relations to a variety of histograms and ways to estimate the operation cost by using histograms.