JSON performance

  • Comments posted to this topic are about the item JSON performance

  • Good question thanks Evgeny

    ...

  • Nice question, thanks Evgeny

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    โ€œlibera tute vulgaris exโ€

  • I think the assertion that "standard indexes" will improve JSON performance is misleading.  That is only the case if "standard indexes" includes indexing on computed columns.  Sticking a normal index on the JSON column will only improve performance to the extent that a covering index improves performance because it reduces the number of pages relative to the clustered index because there are missing columns.  To actually get index-like behavior (the ability to retrieve a subset of records based on their position within the index), one must create a computed column and then index that computed column.  And that's exactly what the link https://docs.microsoft.com/en-us/sql/relational-databases/json/index-json-data indicates.  But I wouldn't usually refer to an index on a computed column as a "standard index".

  • Heh... "JSON performance"... Isn't that what they call an "oxymoron"? ๐Ÿ˜‰

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Another problem: JSON could be stored in a (N)VARCHAR(MAX) field which could not be added to an index (only included, but this would only allow full index scans, even if you use a sophisticated LIKE) ...

    God is real, unless declared integer.

  • Jeff Moden - Monday, February 26, 2018 11:23 AM

    Heh... "JSON performance"... Isn't that what they call an "oxymoron"? ๐Ÿ˜‰

    Yeah, I think it is.  I thought a couple of the answers available were good, though.  They made me turn my head and wonder if they're the "next big shiny thing" on Microsoft's hit list.

  • t.ovod-everett - Monday, February 26, 2018 11:00 AM

    I think the assertion that "standard indexes" will improve JSON performance is misleading.  That is only the case if "standard indexes" includes indexing on computed columns.  Sticking a normal index on the JSON column will only improve performance to the extent that a covering index improves performance because it reduces the number of pages relative to the clustered index because there are missing columns.  To actually get index-like behavior (the ability to retrieve a subset of records based on their position within the index), one must create a computed column and then index that computed column.  And that's exactly what the link https://docs.microsoft.com/en-us/sql/relational-databases/json/index-json-data indicates.  But I wouldn't usually refer to an index on a computed column as a "standard index".

    +1

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply