I’m looking for a faster way to retrieve a list of SKUs of "in stock" products.
I’m using this code
$products_collection = \Mage::getResourceModel('catalog/product_collection')->addAttributeToSelect('sku');
\Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products_collection);
return $products_collection->getColumnValues('sku');
but it’s quite slow, because first it gets all products then filter them by "in stock".
Are there any faster query to execute? Maybe using an inverse style: first get only IDs of "in stock" products then get only their SKUs?