We currently have an audit table of the following form:
TABLE(timestamp, type, data, id) -- all the fields are of type varchar / clob
The issue is that for some types there are actually several well suited ids. We currently only store one of those but it would be interesting to be able to query by any of those ids while still keeping only one column for that.
With Oracle's recent support for JSON we were thinking about maybe storing all the ids as a JSON object:
{ orderId:"xyz123"; salesId:"31232131" }
This would be interesting if we could continue to make queries by id with very good performance. Is this possible? Does Oracle allow for indexing in these kind of situations or would it always end up being a O(n) text search over all the millions of rows this table has?
Thanks