Which one is fast? An Index or a View? Both are used for optimization purposes. Both are implemented against table columns. So can anyone explain which one is faster and what are the differences between both of them and in which scenario do we use a View and an Index?
VIEW
INDEX
ANALOGY:
Suppose you're managing a shop. Assume you have multiple racks. Categorizing each rack based on the type of items is like creating an index. So you know where to look to find a particular item. This is indexing.
In the same shop, you want to manage multiple data types, say, the Products, Inventory, Sales and other things such as a consolidated report. Such a report can be compared to a view.
Hope this analogy properly describes when you have to use a view and when you have to use an index!