Our great sponsors
-
AppMap
AppMap is the ultimate code reviewer for issues that static analysis and AI code assistants cannot find.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Here's a concrete example of a JSONB index and generated column. For this example, I will use a JSON format called AppMap, which represents a class dependency diagram and execution trace of a program. At the top level, the AppMap format includes metadata, classMap, and events.
Now, what if you want to be able to efficiently fetch a subset of JSONB data, without having to load and parse every object? At AppLand, we store AppMap data in the database. Each AppMap has a mandatory section called metadata, and we want to be able to efficiently pull out the metadata of selected rows without having to parse the entire JSONB column (the metadata is usually less than 1% of the total JSON object). Awesomely, since PostgreSQL 12, PostgreSQL has a feature called generated columns.
Related posts
- Automatically Generate and Update OpenAPI Documentation
- Add Swagger to your Rails project, with no code, in 2 ¹/₂ minutes
- Visualize the architecture of your Python app, in VSCode, in 2 ¹/₂ minutes
- Explore and learn any Python library using visual, interactive maps
- Observability of software design - What it is and why it matters