# Processing JSON with PostgreSQL: Normalization, Queries, and Performance Comparison

DevFeed: [Processing JSON with PostgreSQL: Normalization, Queries, and Performance Comparison](<https://devfeed.tech/articles/on-json-and-sql-34566.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2017/09/on-json-and-sql/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2017-09-18T08:49:03Z

Content type: tutorial

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [JSON](<https://devfeed.tech/topics/json.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [Structured-data](<https://devfeed.tech/topics/structured-data.md>)

Tags: [advanced](<https://devfeed.tech/tags/advanced.md>), [json](<https://devfeed.tech/tags/json.md>), [native-sql](<https://devfeed.tech/tags/native-sql.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [schema](<https://devfeed.tech/tags/schema.md>), [sql](<https://devfeed.tech/tags/sql.md>)

## AI overview

A tutorial on processing Magic: the Gathering card data stored in JSON with PostgreSQL. It covers loading the data, normalizing a JSON document into a database schema, querying JSON data with a GIN index, and comparing processing against the JSON and normalized schemas.

## Source excerpt

PostgreSQL has had proper json support for a while now. The unique extensibility approach of the PostgreSQL system allows it to enable native SQL friendly JSON processing. In this article we'll play with the Magic: the Gathering card data in JSON format data set, provided with a CC0 licence, and process the information provided. We also see how to normalize a JSON document into a proper database model that benefits from some PostgreSQL advanced features, and how to then inject the JSON documents into the normalized database schema. Finally, we compare some non-trivial processing done against both versions of the database schema.