How to optimize 'group by' query and indexing on big table?
Calculating three aggregates on a 300 million row table without a filter is going to take some time, especially if the rows have to read from disk. Without knowing anything about types and indexes, it is difficult to give any specific advice, but you may try to replace store_idx with an index like:

CREATE INDEX store_idx ON basket
    (store_region, store_format, store_code, basket_id, shop_date);