1. 5
  1. 2

    Which I think is a much more useful case than the original one he blogged about.

    1. 5

      Except you don’t need virtual columns to do it; they’re just syntactic sugar. I’ve been doing it for years by putting the json_extract call in the CREATE INDEX statement.

      1. 4

        I was going to ask this, I didn’t understand the point of creating virtual columns.

        I think being explicit is better in general. Except maybe if you use virtual columns for compatibility reasons.

        1. 2

          Yes, but virtual columns seem like a “syntactic sugar” feature all together. It just wraps some complexity that you can, of course, implement somewhere else.

          1. 6

            Agreed. Just thought I’d comment since the article could be misread as saying that indexing JSON properties requires virtual columns.

            1. 2

              I definitely misunderstood this. Thank you for clarifying!