7

Do you know index can be added to MySQL view?

Thanks

  • possible duplicate of [Is it possible to have an indexed view in MySQL?](http://stackoverflow.com/questions/244226/is-it-possible-to-have-an-indexed-view-in-mysql) – Joe Stefanelli Jan 24 '11 at 20:21
  • 1
    MySQL doesn't support materialized views. The view support is rather limited, in comparison to other databases. – OMG Ponies Jan 24 '11 at 20:22

3 Answers3

6

Sadly, you can't. You can index the tables the view is based on.

Also, see this question: Is it possible to have an indexed view in MySQL?

Community
  • 1
  • 1
Nanne
  • 64,065
  • 16
  • 119
  • 163
0

Nope.

For more information about indexes and MySQL view performance, read this question.

Community
  • 1
  • 1
Peter Bailey
  • 105,256
  • 31
  • 182
  • 206
0

However, you can use some tricks. Add custom_id field to view and put value of "hash" of another unique field in same row :D

In my case i combine category id and article id