A method for controlling a hydraulic pump in an excavator having an operation unit and an instrument panel, in which a discharge flow rate of a hydraulic pump is controlled by an electronic proportional control valve, and an rpm of an engine, which drives the hydraulic pump, is controlled by the adjusted discharge flow rate, the method comprising: receiving, by a controller, a set discharge flow rate of the hydraulic pump, which is set by an operator through the instrument panel, after an operation with respect to one of the plurality of options which are attachable to an end portion of the arm of the excavator is selected by an operator through the operation unit; scanning, by the controller, an engine revolution speed and a required discharge flow rate in a corresponding section having all of the required discharge flow rate equal to or lower than a maximum discharge flow rate at which the hydraulic pump of the present excavator maximally discharges a flow, and an engine revolution speed to achieve high fuel efficiency, using a table that presents engine revolution speeds and required discharge flow rates to achieve high fuel efficiency, which are stored in a storage means, and a relation that presents fuel consumption according to the engine revolution speed on the basis of the table; calculating, by the controller, a maximum flow rate per engine revolution speed so that a flow is discharged through a hydraulic pump at the set discharge flow rate set on the instrument panel on the basis of the scanned engine revolution speed and required discharge flow rate; and controlling, by the controller, the engine to have an engine revolution speed for discharging a flow at a flow rate closest to the set discharge flow rate set on the instrument panel among the calculated maximum flow rates per engine revolution speed, and outputting a signal current corresponding to the calculated maximum flow rate per engine revolution speed to the electronic proportional control valve so that the discharge flow rate of the hydraulic pump is controlled. receiving, by a controller, a set discharge flow rate of the hydraulic pump, which is set by an operator through the instrument panel, after an operation with respect to one of the plurality of options which are attachable to an end portion of the arm of the excavator is selected by an operator through the operation unit; scanning, by the controller, an engine revolution speed and a required discharge flow rate in a corresponding section having all of the required discharge flow rate equal to or lower than a maximum discharge flow rate at which the hydraulic pump of the present excavator maximally discharges a flow, and an engine revolution speed to achieve high fuel efficiency, using a table that presents engine revolution speeds and required discharge flow rates to achieve high fuel efficiency, which are stored in a storage means, and a relation that presents fuel consumption according to the engine revolution speed on the basis of the table; calculating, by the controller, a maximum flow rate per engine revolution speed so that a flow is discharged through a hydraulic pump at the set discharge flow rate set on the instrument panel on the basis of the scanned engine revolution speed and required discharge flow rate; and controlling, by the controller, the engine to have an engine revolution speed for discharging a flow at a flow rate closest to the set discharge flow rate set on the instrument panel among the calculated maximum flow rates per engine revolution speed, and outputting a signal current corresponding to the calculated maximum flow rate per engine revolution speed to the electronic proportional control valve so that the discharge flow rate of the hydraulic pump is controlled.