Forum Moderators: open
If the code does a fresh query to get the cart content after adding, then the lack of an index on, say, the customer ID (or customer ID + item ID), would certainly slow things down if you have a lot of customers, as it would have to do an exhaustive search through the database.
Has it gotten progressively worse? Are reports on customers or orders slow as well?
If this is the issue, hate to tell you, but this is Database 101. Get a more experienced programmer next time.
the problem the indexing is causing makes it so when we add a new picture or add a new product (new html page in essence) they are not showing up.
There is no reason why indexing would cause this. Indexing is completely transparent to applications. (With the exception of applications that might interact in some way with the database schema - that is unlikely in this case.) Indexing just makes access faster when the database is accessed through an indexed key.
I do think you need to have a programmer look at this. It's clear that your old programmer was "experience challenged" :) Who knows what bizarre coding he might have done?
Indexing does take more time when adding database records. One possibility is that the addition of the record and the display of the record are being done in different processes, and the database wasn't locked during the add. So, the display code was run before the add was actually completed. This is also Database 101.
Are the new records simply not added (also not shown upon subsequent viewing), or just not displayed immediately after the add?