GithubHelp home page GithubHelp logo

json_sql_server_explore's Introduction

SQL Server JSON Performance Playground

Background: The question arose to the impact of storing data as JSON in SQL server. This is a simple to attempt to checkout some common scenarios.

Setup:

  1. Create a SQL Server Database Named Test
  2. Give permissions to a user and pass you have created
  3. Run the script create_table.sql in your preferred SQL Server IDE, or from sqlcmd
  4. Make sure you have pyodbc package installed (in virtualenv if preferred) using pip install pyodbc
  5. Set environment variables for username and password to connect to db (see comments near the top of load.py). Optional: set number of records in the variable RECORD_COUNT
  6. run: python load.py

Now you can use the following scripts:

  • json_sample_queries.sql to explore how to query with json
  • average.sql to compare a column average with json column average. The timing info will be in the message tab if using SSMS.
  • index_test.sql to compare filtering a record by a string with a column, vs a json value, including indexing the json value. The timing info will be in the message tab if using SSMS.

You can email me with any questions or feedback at tim at hoolihan.net, or open a pull request with suggested changes.

json_sql_server_explore's People

Contributors

thoolihan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.