Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.ms-sqlserver > #2260
| Path | csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Erland Sommarskog <esquel@sommarskog.se> |
| Newsgroups | comp.databases.ms-sqlserver |
| Subject | Re: No covering indices for table types? |
| Date | Fri, 12 Jul 2024 23:48:29 +0200 |
| Organization | Erland Sommarskog |
| Lines | 29 |
| Message-ID | <XnsB1ADF2304F6C3Yazorman@127.0.0.1> (permalink) |
| References | <20240712151501.d23ddf433e73ae41365603cf@g{oogle}mail.com> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252 |
| Content-Transfer-Encoding | 8bit |
| Injection-Date | Fri, 12 Jul 2024 23:48:29 +0200 (CEST) |
| Injection-Info | dont-email.me; posting-host="0547cc3ad099b84950579cf5d5a84856"; logging-data="3376818"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Ze1YqgtZuieoftM5yIHqt" |
| User-Agent | Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32) |
| Cancel-Lock | sha1:vyYKqE/kLIRT5vA/1CRY2PRFZB0= |
| Xref | csiph.com comp.databases.ms-sqlserver:2260 |
Show key headers only | View raw
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.
Back to comp.databases.ms-sqlserver | Previous | Next — Previous in thread | Next in thread | Find similar
No covering indices for table types? Anton Shepelev <anton.txt@g{oogle}mail.com> - 2024-07-12 15:15 +0300
Re: No covering indices for table types? Erland Sommarskog <esquel@sommarskog.se> - 2024-07-12 23:48 +0200
Re: No covering indices for table types? Anton Shepelev <anton.txt@g{oogle}mail.com> - 2024-07-15 14:27 +0300
csiph-web