Viewing 13 posts - 1 through 13 (of 13 total)
is it ok to have a clustered index on recorddate? I have two rows per device per day for the recorddate.
May 11, 2012 at 1:33 pm
this is how devicehistory is indexed
indexes on the devicehistory table are as follows:
primary key = id
recorddate ascending = non unique, non clustered
datesubmitted ascending = non unique, non clustered
archived ascending =...
May 10, 2012 at 8:05 pm
I havent had a chance to setup a test environment yet. I was hoping to find something a little simpler to do, but it doesnt seem that there will be!
May 10, 2012 at 8:18 am
just wanted to bump and get any other suggestions before I try what Vic has recommended.
May 7, 2012 at 6:27 am
vicdileo (5/4/2012)
May 4, 2012 at 5:54 am
sorry, I misunderstood.
here are two of them. explan is the original query, and explan1 is a larger version of the query that took 4 minutes to run.
May 3, 2012 at 7:39 am
vicdileo (5/1/2012)
8) if so, then what does the query plan look like when your WHERE IN has 16,000 deviceid's?
its actually 1600+, Ive attached one for 720 devices
I don't see the...
May 3, 2012 at 6:15 am
Lynn Pettis (5/1/2012)
SELECT
deviceid,
archived,
AVG(CASE WHEN recorddate > DATEADD(day, -7, getDate()) THEN d2.estgasvolmcf ELSE...
May 1, 2012 at 12:55 pm
7) does the query plan you provided come from the same query that appears in your post?
yes
8) if so, then what does the query plan look like when your...
May 1, 2012 at 12:52 pm
vicdileo (5/1/2012)
Regarding the query plan:
I don't see any table scans, so that's good.
It looks like the query plan is probably not being...
May 1, 2012 at 11:53 am
Lowell (5/1/2012)
two different WHERE statements have a function on a datetime column...
WHERE DATEADD(day, 15, time) > GETDATE()
--and later:
AND CONVERT(DATE, recorddate) = '2012-04-25'
this requires SQL to do...
May 1, 2012 at 8:20 am
1) Copy the plan and post it here.
attached
How is this query being run:
2) As a stored procedure?
no
3) AS embedded SQL in a C# program or Java, etc.?
yes, java
4) Is this...
May 1, 2012 at 7:10 am
bump. can anyone point me in the right direction?
April 30, 2012 at 7:11 pm
Viewing 13 posts - 1 through 13 (of 13 total)