* TSX ends up 2.79 points at 22,468.16

* Posts new all-time closing high

* Canadian inflation cools to 3-year low

* Materials sector adds nearly 1%

May 21 (Reuters) - Canada's main stock index ended slightly higher on Tuesday as commodity-linked stocks climbed and domestic inflation data raised prospects of the Bank of Canada beginning an interest rate cutting campaign next month.

The Toronto Stock Exchange's S&P/TSX composite index ended up 2.79 points at 22,468.16, eclipsing Friday's record closing high. The index was closed on Monday for the Victoria Day holiday.

"It looks like the areas of the economy and the markets we need for the TSX to move higher are moving higher and that bodes well for the rest of the year," said Allan Small, senior investment advisor of the Allan Small Financial Group with iA Private Wealth.

Financials account for 29% of the Toronto market, while resource shares account for an additional 33%.

The materials group, which includes metal miners and fertilizer companies, rose nearly 1% as the price of gold stayed close to a record high it posted on Monday.

Energy also gained ground, rising 0.8%, even as the price of oil settled 0.7% lower at $79.26 a barrel.

Financials gave back some of their recent gains, with the sector ending 0.3% lower ahead of the start of bank earnings season on Thursday.

Canadian banks are expected to set aside money for challenging days, which will hurt quarterly earnings, as investors await commentary on how the lenders will navigate a prolonged high interest-rate environment that has dented credit growth.

Still, investors raised bets on the Bank of Canada cutting rates at its next policy decision on June 5 after data showed Canada's annual inflation rate slowing to a three-year low of 2.7% in April.

ATS Corporation was among the biggest decliners. Shares of the automation solutions provider fell 5.2% after RBC reduced its price target on the stock to C$60 from C$65. (Reporting by Fergal Smith in Toronto and Khushi Singh in Bengaluru; Editing by Marguerita Choy and Tasim Zahid)