Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 4
    A <5 minutes look into the MySql manual revealed: you can create tables with generated columns, you can use that to create an extra column which extracts the start_time from a JSON column, and you can place an index on this generated column as well as a primary key constraint. So why don't you simply try this out? Commented Sep 22, 2021 at 20:52
  • @DocBrown This looks like it will work. Thank you! Commented Sep 23, 2021 at 2:58
  • In your example, your data looks very flat. If that's the case, you could design the table according to the fields in your JSON object, so the JSON object becomes a record in this table, and generate a JSON object when you read from the table. Commented Sep 23, 2021 at 3:42
  • @simgineer: you are welcome. I would recommend to move the solution you found from the question into an answer (and accept it), that works better with the way the site is designed. For example, it lets people vote individually for the question and the answer. And avoid to use phrases like "Edit", anyone can see the question's history and timeline using the related buttons above. Commented Sep 23, 2021 at 5:26
  • @Green The data actually has more interesting data that is not necessarily flat and potentially child objects with attributes, arrays, etc. Commented Sep 24, 2021 at 4:37