Indexing is a way of storing column values in a data structure designed for quick searches. This greatly speeds up the search compared to a full table scan, since not all rows need to be checked. You should consider the presence of indexes in columns in WHERE clauses.
Sharding is a method of sharing a table between different machines. This allows for parallel resolution of requests. For example, half the table can be searched on one machine, and the other half on another machine. This in some cases will improve performance by adding more hardware, especially for large tables.
Emil Vikström
source share