calculating % difference for every row with the same ID
I wrote out an answer that works in SQL Server before noticing you have this question tagged as MySQL.  For context, if you weren't in MySQL you'd use the LAG function like this:

SELECT 
    s.P_date, 
    s.Company, 
    s.Price, 
    s.Price/s.Last_price as Percent_diff
FROM
(   SELECT 
        t.P_date, 
        t.Company, 
        t.Price,
        LAG(t.Price) OVER (PARTITION BY t.Company ORDER BY t.Company, t.P_Date)  Last_price
    FROM YourTable as t
) as s


The LAG line selects the Price value from the last record for the same company, allowing the outer query to do the percent calculation.

But MySQL doesn't support LAG.  Luckily there's an answer on Stack Overflow that shows how to simulate LAG in MySQL.  It even uses an example table almost identical to yours:

https://stackoverflow.com/questions/11303532/simulate-lag-function-in-mysql

I suggest you do this as a view, not a table.  That way the calculation will only run when you select from the view, leaving you free to update your main table without worrying about those million rows bogging you down.