Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Erland Sommarskog Newsgroups: microsoft.public.sqlserver.programming Subject: Re: Assigning Display Lines to Date Ranges Date: Thu, 12 Nov 2015 22:44:33 +0100 Organization: Erland Sommarskog Lines: 15 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="265adb1c021f4e45f9de4dc4b7d8dc41"; logging-data="21311"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/E8DC+VZ2Hwpz+QaDjuQeb" User-Agent: Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32) Cancel-Lock: sha1:gaiGbcuyG90kjX1xZOru734gC48= Xref: csiph.com microsoft.public.sqlserver.programming:31278 Michael Cole (invalid@invalid.com) writes: > I would prefer a set-based solution, as there will be a lot of data to > go though (about 1500 ranges) and it needs a response time of less than > 15 seconds maximum (less than 10 would be better.) It is far from certain that a set-based query would be the fastest in this case, although I have not tried anything yet. But if the ranges are tied to different entities that are separate from each other, you could iterate over the entities in parallel. A key question: which version of SQL Server are you using? -- Erland Sommarskog, Stockholm, esquel@sommarskog.se