In this work two approaches of backward chaining inference implementation were compared. The first approach uses a classical, goal driven inference running on the client device — the algorithm implemented within the KBExpertLib library was used. Inference was performed on a rule base buffered in memory structures. The second approach involves implementing inference as a stored procedure, run in the environment of the database server — an original, previously not published algorithm was introduced. Experiments were conducted on real-world knowledge bases with a relatively large number of rules. Experiments were prepared so that one could evaluate the pessimistic complexity of the inference algorithm.