Page 1 of 1

Database Table Indexes in OpenCart

Posted: Sun Feb 28, 2010 3:29 am
by Sheldmandu
I've just reviewed the database structure of OpenCart, and although I think the database is very well designed in terms of good database design principles and consistent naming, I was shocked to find that there were practically NO INDEXES defined on the database with the exception of primary keys.

What this means is that for any store with a large number of products (i.e. 50,000, like in our case) the store would not perform very well.

As the absolute minimum indexes should be defined on
- Foreign key fields by which data is queried or joined
- Fields on which data is filtered (e.g. on Products this would be Price, Status, etc)

Can someone on the core development team please add proper indexes to tables or let me know how I can contribute this into the core.

Re: Database Table Indexes in OpenCart

Posted: Tue Mar 02, 2010 3:28 am
by Miguelito
A very good point - database is the basic data machine behind this all. Hopefully Daniel & core team will see this thread and contact you :)

Re: Database Table Indexes in OpenCart

Posted: Tue Mar 02, 2010 3:50 am
by rph
The quickest way is probably to make the changes to opencart.sql and submit it to Daniel though it can unfortunately be rather difficult to get changes included. For existing websites you could release an SQL file making the changes to the board and user mods section.

Re: Database Table Indexes in OpenCart

Posted: Mon Feb 25, 2019 4:55 pm
by AndCycle
it's 2019, and I still need to do the index by my self, well done.

Re: Database Table Indexes in OpenCart

Posted: Mon Feb 25, 2019 9:10 pm
by IP_CAM
Well, such an extension exists for Years already, but if you
expect everything, to be built-in already by default, you better
look around for a paid Software, then you might have a reason to.
Ernie
https://github.com/lilalaunesau/opencart-turbo