Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Michael Cole Newsgroups: microsoft.public.sqlserver.programming Subject: Re: Assigning Display Lines to Date Ranges Date: Fri, 13 Nov 2015 09:01:42 +1100 Organization: A noiseless patient Spider Lines: 22 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15"; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 12 Nov 2015 22:00:18 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="5ab04e74274105c4a6c81eb9c3e4dc06"; logging-data="28443"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/yg/N2yz8aY69c7Td3VMDE" X-Newsreader: MesNews/1.08.06.00-gb Cancel-Lock: sha1:6tr4ovQYEUAIU9t8YBXAcwZ00U8= X-ICQ: 1701145376 Xref: csiph.com microsoft.public.sqlserver.programming:31279 Erland Sommarskog has brought this to us : > 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. They are. We are looking at about 70 entities, with a complete date range of about a year. Individual ranges of about a month. For the record, they are for bricklayers on new house builds. > > A key question: which version of SQL Server are you using? Its eventually going to end up on Azure. I'm not quite sure if that makes it more difficult... -- Michael Cole