Is it possible to have an indexed view in MySQL?

后端 未结 4 921
谎友^
谎友^ 2020-11-27 21:08

I found a posting on the MySQL forums from 2005, but nothing more recent than that. Based on that, it\'s not possible. But a lot can change in 3-4 years.

What I\'m l

4条回答
  •  佛祖请我去吃肉
    2020-11-27 21:34

    Do you only want one indexed view? It's unlikely that writing to a table with only one index would be that disruptive. Is there no primary key?

    If each record is large, you might improve performance by figuring out how to shorten it. Or shorten the length of the index you need.

    If this is a write-only table (i.e. you don't need to do updates), it can be deadly in MySQL to start archiving it, or otherwise deleting records (and index keys), requiring the index to start filling (reusing) slots from deleted keys, rather than just appending new index values. Counterintuitive, but you're better off with a larger table in this case.

提交回复
热议问题