Magento 2.3 stock update in DB level

I’m Currently using magento2.3, i have added a cron job to update products stock every 20 min from external inventory which will create a CSV file to magento directory, i will read this file and loop
to the quantity and create a SQL query to update it to cataloginventory_stock_item table and run reindex.

Quantity get updated but not showing add to cart in front-end , after product save manually from admin it’s working fine. It is proper method to update qty or else there is any other method for performance using this method, because our store having more then 20K+ products