Implantable heart stimulator comprising a control unit including a memory, a sensing unit, a pulse stimulation unit adapted to generate stimulation pulses separated by a variable predetermined pacing interval (PI), and also a method in a heart stimulator. The heart stimulator is adapted to be connected to one or many heart electrode leads provided with stimulating and sensing electrodes in order to stimulate heart tissue by said stimulation pulses and sense electrical heart events. The heart stimulator comprises a control parameter measurement unit adapted to derive a control parameter value indicative of end-diastolic pressure (EDP). At specified intervals, the control unit is adapted to vary the predetermined pacing interval (PI) according to a predetermined pacing interval (PI) search session scheme, and that control parameter values are determined, by said control parameter measurement unit at the different pacing intervals tested during said PI search session, and in that determined control parameter values and corresponding pacing intervals are stored in said memory. The maximum control parameter value obtained during one PI search session is determined and the corresponding pacing interval, denoted PIopt, is identified and used when stimulating the heart resulting in a maximal end-diastolic pressure.