Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.ms-sqlserver    |    Notorious Rube Goldberg contraption    |    19,505 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 19,491 of 19,505    |
|    Erland Sommarskog to Anton Shepelev    |
|    Re: No covering indices for table types?    |
|    12 Jul 24 23:48:29    |
   
   From: esquel@sommarskog.se   
      
   Anton Shepelev (anton.txt@g{oogle}mail.com) writes:   
   > Hello, all.   
   >   
   > I wanted to create a convenient table-type for storing time   
   > series (with possibly non-uniqe sample marks):   
   >   
   > CREATE TYPE series_t AS TABLE   
   > ( moment DATETIME NOT NULL,   
   > value FLOAT   
   > )   
   >   
   > For efficient querying and joining, I need a covering index   
   > on the [moment] field that includes [value], but the INCLUDE   
   > keyword does not seem to be suported:   
   >   
      
   Starting with SQL 2019, it is:   
      
   CREATE TYPE series_t AS TABLE   
    ( moment DATETIME NOT NULL,   
    value FLOAT,   
    INDEX Main(moment)   
    INCLUDE (value)   
    )   
      
   If you are an older version, I would suggest adding value as an index key   
   is the best in most situations.   
      
   I will submit an edit to the CREATE TYPE topic.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca