Image source: Getty Images Supermarket shares like Sainsbury’s (LSE:SBRY) saw monumental declines in 2022 due to the cost-of-living crisis. Nonetheless, the stock is now up 40% from its bottom, and even reported a positive set of Q3 results. With a decent dividend yield of 5%, I could be tempted to buy the stock. Christmas cheer Sainsbury’s released its latest Q3 update yesterday. There was an improvement to its underlying sales growth, but it’s important to note that the numbers don’t take the impact of double-digit grocery inflation into account. MetricsQ3 2023Q3 2022Grocery5.6%12.5%General merchandise4.6%-6.9%Like-for-like sales (ex. fuel)5.9%-4.5%Like-for-like sales (inc. fuel)6.8%0.6%Data source: Sainsbury’s Nevertheless, CEO Simon Roberts was still bullish. He upgraded the FTSE 100 firm’s outlook, and now expects profits before tax to hit the upper end of its guidance of £630m to £690m. He even raised the company’s free cash flow guidance to £600m for FY23. Sainsbury’s results aren’t eye-catching by any means, but this update showed plenty of encouraging signs that the company is beginning to establish a unique position among consumers. In fact, it outperformed many of its largest competitors on many fronts. Seeing the difference Its investment of £550m to expand its Aldi price match range, and delay raising prices after the rest of the market, has proven to be beneficial. Consequently, the average selling price for its top 100 products is the lowest in the industry. As a result, customer satisfaction hit an all-time high in Q3. Hence, it’s no surprise that Sainsbury’s did so well over the Christmas period. Additionally, the board mentioned that it’s seeing less down-trading to other supermarkets. And despite declines in grocery volumes, it still managed to outperform Tesco, Asda, and Morrisons in the quarter. This shows that its investments are paying off, and the latest Kantar grocery market share data backs this up. Since bottoming in September, Sainsbury’s has staged a strong recovery, taking market share away from the likes of Asda and Morrisons. Data source: Kantar Picking the best stock So, are Sainsbury’s shares worth buying? Well, its dividend yield of 5% is well covered at 1.9 times. As such, the group’s dividends could help me generate passive income, given the strong history of paying steady and growing dividends. Data source: Sainsbury’s Moreover, its strong debt-to-equity levels, declining debt pile, and steady free cash flow are definitely a positive. That being said, its razor-thin profit margins of 1%-2% are something I’m wary of. Management’s move to increase prices later than the rest of the industry allowed it to capture market share. But this also prevents Sainsbury’s from expanding its margins. Data source: Sainsbury’s I’m confident that the Sainsbury’s share price should see further upside in the short term. Food inflation is finally starting to trend down, and the declines in energy and commodity prices are yet to be realised. Even so, I don’t quite see how Sainsbury’s shares can grow exponentially over the long term. The conglomerate’s e-commerce businesses are growing, but not enough to grow its bottom line substantially. Data source: Kantar The stock’s valuation multiples certainly indicate fair value at these prices, and its history of steady dividend payments are definitely worthy of an investment. MetricsValuation multiplesPrice-to-earnings (P/E) ratio10.0Price-to-sales (P/S) ratio0.2Price-to-book (P/B) ratio0.7Price-to-earnings growth (PEG) ratio0.1Data source: YCharts However, there are other UK shares with better growth potential, higher dividends, and better margins, such as Glencore and Taylor Wimpey. I’m more inclined to invest in those names rather than Sainsbury’s shares. After all, JP Morgan has an ‘underweight’ rating on the stock with a price target of £2.13.