Weird Optimizer Choice

Jul 20, 2005

I'm very puzzled by the choice of NC index being made by the optimizer
in this example. I don't actually think it should use an NC index at
all.

I have:

Table: CustomerStatus_T
Single data page
19 records
Clustered Index on CustomerStatusID:

CREATE TABLE [CustomerStatus_T] (
[CustomerStatusID] [int] NOT NULL ,
[Name] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Description] [varchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[Code] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[CodeAlt] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Ordinal] [int] NULL ,
[Default] [int] NULL ,
[Display] [bit] NOT NULL ,
[StatusType] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,
[DateCreated] [smalldatetime] NULL ,
[DateUpdated] [smalldatetime] NULL ,
[DateArchived] [smalldatetime] NULL ,
CONSTRAINT [PK_ROMS_CustomerStatus] PRIMARY KEY CLUSTERED
(
[CustomerStatusID]
) ON [PRIMARY]
) ON [PRIMARY]


If I run the following query, it does exactly what I expect and scans
the clustered index:

SELECT customerStatusID, [Name] FROM CustomerStatus_T
WHERE dateArchived IS NULL
AND Display = 1
AND StatusType = 'Q‘

and gives the following QEP and IO statistics:

|--Clustered Index Scan
(OBJECT:([Reach_Roms].[dbo].[CustomerStatus_T].[PK_ROMS_CustomerStatus]),
WHERE:(([CustomerStatus_T].[DateArchived]=NULL AND
[CustomerStatus_T].[StatusType]='Q') AND
Convert([CustomerStatus_T].[Display])=1))


Table 'CustomerStatus_T'. Scan count 1, logical reads 2, physical
reads 0,
read-ahead reads 0.


If I now put a NC index on the statustype column:
create index ix_nci_statustype on customerstatus_t(statustype)

the query plan changes to:

SELECT customerStatusID, [Name] FROM CustomerStatus_T
WHERE dateArchived IS NULL
AND Display = 1
AND StatusType = 'Q‘


|--Filter(WHERE:([CustomerStatus_T].[DateArchived]=NULL AND
Convert([CustomerStatus_T].[Display])=1))
|--Bookmark Lookup(BOOKMARK:([Bmk1000]),
OBJECT:([Reach_Roms].[dbo].[CustomerStatus_T]))
|--Index
Seek(OBJECT:([Reach_Roms].[dbo].[CustomerStatus_T].[ix_nci_statustype]),
S EEK:([CustomerStatus_T].[StatusType]='Q') ORDERED
FORWARD)


Table 'CustomerStatus_T'. Scan count 1, logical reads 7,
physical reads 0, read-ahead reads 0.

For some bizarre reason, the optimizer thinks that a NC index lookup
on a single-page table, which ultimately costs 7 IOs, is cheaper than
a table (or Clustered Index) scan of a single page. Why? The
showplan cost also shows that it expects the NC index to be cheaper
(which is presumably why it goes and uses it), but even after running
UPDATE STATISTICS on the table it still chooses the same idiotic query
plan.

Any thoughts, or has anyone seen similar behaviour before, and can
anyone please explain it to me?

p.s. I don't actually WANT to put a NC index on this table, but I
noticed the behaviour by accident which is why I'm asking the question
:-)

View 3 Replies


ADVERTISEMENT

What Is The Best Sort Order Choice ?

Jul 5, 2000

In Sql6.5 we use binary sort order for a best performance (I think). I hear that it should be highlighted that the case for binary sort order being the fastest method of sorting and searching a database no longer applies at SQL 7.0
Is it right and why ????

View 1 Replies View Related

Is Clustering Ever A Better Choice Than Mirroring?

Nov 8, 2007

clustering sounds expensive and arcane. Is it ever a better choice than mirroring for high availability? Perhaps when the size of the db copy is too prohibitive under the mirroring option?

View 1 Replies View Related

Temp Table Vs View - Which Is The Better Choice ?

Jun 1, 2007

If There are very lots of data to retrieve to show in any inquiry forms.each inquiry forms need to use a lot of table. There are two methods I thought First, Prepare data to Temp table when arise any transaction and Program then retrieves data from temp table. Second, Create view for retrieving data  Which method is the better choice ? How ? (More fast, More performance or More flexible ? )  Please advise me....   

View 1 Replies View Related

Development Tool Choice For SQL Server

Nov 16, 2006

Is VB.net the most logical choice of a RAD tool to use with MS SQL Server? Is VB.net strictly for web apps or can you use it to create projects that run as executables off the server?

JustStartinOut

View 12 Replies View Related

Any Other Choice Than Left Outer Join??

Apr 13, 2008

i have three tables company as co, Procurement as po,contracts as cr
Co_id as primary for co
co_id forign for po
co_id forign for cr

i want the query to get me only one record for every co_id if it has a company in certain PO or CR ( i used max fnctn to get me only one record)

result:

CO_ID,PODOCNO,CRDOCNO
----- ------- -------
1 350 400
2 355 1064
3 NULL 500
4 600 NULL

I used the left outer join in this manner


SELECT CO.CO_ID, MAX(PR.DOCNO) AS pO_DOCNO ,MAX(CR.DOCNO) AS CR_DOCNO
FROM COMPANY CO lEFT OUTER JOIN PROCUREMENT PR ON OG.CO_ID=PR.CO_ID lEFT OUTER JOIN CONTRACT CR ON CO.CO_ID=CR.CO_ID
GROUP BY OG.CO_ID


the result is ok but the problem its taking infinte time if i add more tables to the outer join, i have more tables and each with huge number of records

any better way to do this ?? its true performance is a big deaaaal

View 8 Replies View Related

Sql Server To MSDE - Good Choice?

Jul 20, 2005

Hi - I have a rather unreliable host just now - but they offer .net, sqlserver and SSL for a reasonable price.Problem is, the domain is hosted on a shared server - and it keeps goingdown apparantly because of code which is less than clean, on somepeoples sites. (ie. not closing connections etc).I am considering moving to a decicated server - but at this point intime, cannot afford a full SQL Server licence for it - however, thededicated server does offer MSDE. Is it acceptable to go back to usingthis from SQL Server - for a currently low hit site - ie. around 500hits per day.Does MSDE offer stored procedures (I don't use views or triggers)? CanI just take a DTC backup/export of my current SQL Server database, andrestore it to the MSDE one?What would be the cut-off point for using MSDE?Thanks for any info - also, if anyone knows why UK companies charge somuch more dor dedicated servers, than US companies - I'd be interested.Thanks, Mark*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!

View 2 Replies View Related

Is Enterprise Edition Is A Good Choice?

Apr 15, 2008

Hi,

I created a application in VB and backend database for this is SQL Server 2005. So far I was working on "SQL Express", as a testing one. I have almost 20 Tables and also lot of stored procedure. From the programming point of view, the database is not that much of large. The size grows only when the pictures are added to the database. Its not a client/server application(only desktop application).

If i install Enterprise Edition, will it Consumes large space and memory into the client machine. What about performance issue.

Right now i have two editions SQL Express and SQL Enterprise Edition.

Which edition you would like to suggest on the basis of information provided as above.

Thanks.

Best Regards
Kashif Chotu

View 6 Replies View Related

Mutiple Backup Is Good Choice?

Feb 9, 2008



Hi,

I am using a stored procedure to take backup of my database from the Visual Basic Programming.

Before i posted one of my thread with the same thing, so i was recommended to go through with DMOSQL do deal with SQL server with Visual Basic Programming. For me, this takes some time to understand the complete concept.

Because of urgent i am using stored procedure to take backup with the following:

---------------------------------------------------------------------------------------
ALTER PROCEDURE dbo.BackUPBLMSDB

(
@RP nvarchar(200)
)

AS

declare @backupfilename nvarchar(200)
set @backupfilename=@RP
BACKUP DATABASE [BLMSDB] TO DISK = @backupfilename WITH NOFORMAT, NOINIT, NAME = N'BLMSDB-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
---------------------------------------------------------------------------------------
Example @RP="D:ackupBackup-1 09-02-2008 11-24"


Every time i am passing a parameter with somename and dateandtime(System).
Example

Backup-1 09-02-2008 11-24 2900KB
Backup-1 09-02-2008 12-30 2900KB
Backup-1 09-02-2008 18-10 5400KB
Backup-1 09-02-2008 22-00 2900KB
Backup-1 09-02-2008 22-00 2900KB

I would like to clear my doubt, is it a good practice to take backup with different names. The above one i store four backups . If the system crashes and i created the new database with the same schema without any data present in the tables, can i restore previous backup database to the newly created database.

Moreover, The first two backups contains "2900KB", the third one is "5400KB" after the data is being modified. Look at the fourth one it is "2900KB". Why the size is being reduced to "2900KB" after taking backup eventhough i didn't delete or added data into the database.



Hope you will solve my problem.

Thanks.



Best Regards,
Kashif Chotu





View 5 Replies View Related

Optimizer

May 7, 2008

Hello, first of all thanks to share greats posts.

I try do some tests and I get one doubt, why the optimizer don€™t make a constant scan in normal tables, for instance:




Code Snippet
--drop table #tmp
create table #tmp (id Int Identity(1,1) Primary key, name VarChar(250))
go
insert into #tmp(name) values(NEWID())
insert into #tmp(name) values(NEWID())
go
set statistics profile on
go
-- Execution plan create a Constant Scan
select * from #tmp
where id = 1 and id = 5
go
set statistics profile off

GO

--drop table tmp
create table tmp (id Int Identity(1,1) Primary key, name VarChar(250))
go
insert into tmp(name) values(NEWID())
insert into tmp(name) values(NEWID())

go
set statistics profile on
-- Why execution plan does not create a Constant Scan for this case?
select * from tmp
where id = 1 and id = 5
go
set statistics profile off





Thanks

View 4 Replies View Related

User Not A Choice When Trying To Add To Db_owner Role For Database

Mar 14, 2008


How do I get a particular user to be a choice under the db_owner role for a particular database?
The user is listed under logins and even shows to be the db_owner for the database under the database access tab of the login properties. This is SQL 2000.
Thanks,
David P.

View 1 Replies View Related

Urgent - Client Application Database Choice

Oct 31, 2006

We have a small accounting application which is currently based using DBASE database. We need to change the DB and considering SQL Express. However, is some one can clarify following, it would be very helpful:

1) Application is used mostly by standalone non-technical users. There are cases where more than one user will need to connect to DB.

2) We need to ensure that user can not modify database outside of our application. This is needed to ensure database does not get currpted or passwords lost and then no one can open the database.

3) Installation needs to be simple without providing any options to users except where to install database or point to already installed DB in case its a network environment where 2-3 users can be working on the same database.

4) Application is usually installed on normal desktop machines. So, DB should not load the PC heavily.

Please advice if SQL Express is the right direction even with these constraints? What are the other alternatives? We are open to have a small consulting project as well with someone who can guide us through these issues. Email to contact is rkabra101@yahoo.com



rick

View 1 Replies View Related

Query Optimizer

Jul 12, 2001

Hello,

I have a SQL command which I run on two separate servers. Both servers and configured and built the same. On server 1 it takes mere seconds, but on server 2 it takes over 5 minutes.

I have checked the execution plan on both servers and they are completely different. I ran UPDATE STATISTICS WITH FULLSCAN on both servers, but the execution plans were still different.

My question is why are the execution plans so different and how do I get them to execute with the same plan.

Thanks,
Chris.

View 1 Replies View Related

Strange Optimizer

Jul 20, 2005

I tried this:use northwindgoSELECT OrderDateFROM Orders WHERE OrderDate > '19950101'see the query plan? okSELECT OrderDate, EmployeeIdFROM Orders WHERE OrderDate > '19950101'see the query plan? what appened?the only way to make an index seek instead of an index scan is toforce theindex usage ( with(index=orderdate) ), but I don't like this solutionalso try this:SELECT *FROM Orders WHERE employeeId > 9andSELECT *FROM Orders WHERE employeeId > 8Can someone explain why this appens? and how can I overturn theperformance loss problem (well not in orders table, but in my tablethere are 300K records and making a scan to retrieve 50 records is notexactly what I want)thanks to all

View 2 Replies View Related

Optimizer Not Working?

Oct 31, 2007

Hi,

The product uses a simple stored procedure. The query times out when there are five million records in the table. It looks like below:


DECLARE


@CreatedStatus int,

@PendingStatus int;

SELECT


@CreatedStatus = [LV].[ufGetCode]('SaleStatus', 'Created'), -- which returns 1001

@PendingStatus = [LV].[ufGetCode]('SaleStatus', 'Pending'); -- which returns 1002


SELECT *

FROM LV.Detail WITH (READPAST)

WHERE Status = @CreatedStatus OR


Status = @PendingStatus;


Status columne is non-clustered index. The query takes more than 30 seconds. But when i use the query below:

SELECT * FROM LV.Detail WITH (READPAST) WHERE Status = 1001 or Status = 1002
The query is done very fast. No time out.


Anybody knows what makes difference? I am using SQL 2005.

View 3 Replies View Related

What Is An Optimizer In MS SQL Server ?

Mar 12, 2008



What does mean by Optimizer in MS SQL ? What is it ?
How do you use it ? what are the benifits of use it ?

View 4 Replies View Related

Considering Service Broker For Auditing Biz Object Data, The Right Choice?

Sep 6, 2007

We have several applications that work with product catalog data. Data is entered and maintained, searched, and reported on. We're using CSLA business objects to create our Biz Objects and our front end apps are ASP.NET pages and web services. SQL 2k5 is our database. Currently all data is done in Factory methods in our business objects using SQL Stored Procedures and UDF's.

We want to start storing auditing and statistics data on our product searches. In SQL 2k we were using SQL Profiler to capture data and storing the information in tables, but it really wasn't very flexible and was difficult to maintain. What we want to do is every time someone submits a search we store the critiera and the results. Every time someone edits a product we want to save the old record. This will allow us to provide historical reporting and statistical reporting to our users.

In our old system the search results table was at about 3 million records. And since we've moved to a web based application we're hoping to save this information asynchronously so our search results or postbacks are not held up by saving this audit data. We were talking about writing logic into our biz objects code but it all seemed a bit slow and difficult to do asynchronously. Then I read a couple posts suggesting Service Broker.

Now we're considering either writing triggers on our tables or adding code to our factory stored procedures to send messages to Service Broker that would save the data into our audit tables but not hold up our business processes. We would be saving to the same database on the same server, but different tables.

Does Service Broker seem like it could be the right tool for this job? There looks like a bit of a learning curve and before I jump in i'm looking for some advice or direction.

Thanks, larry

View 1 Replies View Related

How To Design Dynamic Reports Based On User's Choice

Dec 13, 2006

Hi all,

I'm a beginner to Report Services, and have tons of questions.

Here's the first one:

if the reports are created based on the condition that the user selects, how can I create the reports with Report Services?

For example,

the user can select the fields that will be shown on the reports, as well as the group fields, the sort fields and restrict fields. So I would not be able to pre-create all possible reports and deploy them to the report server, and I think I should create the reports dynamicly based on what the user select.

Could someone tell me how to do it (create and deploy the reports)?

Thanks a million!

Jonee

View 1 Replies View Related

Writing To A Delimited Flat File But With My Choice Of The Delimiter.

Sep 21, 2006



Hi Folks,

I would like to write my table to a delimited file but I seem to have no choice but to use comma as the delimiter. Is there any way I can choose the delimiter ?

Thanks.

Sid

View 3 Replies View Related

Sql Server Query Optimizer

Feb 7, 2008

Hi,
   Can some one please send me the Sql Server 2005 QUERY OPTIMIZER artilce links?
Thanks

View 1 Replies View Related

Sql 2000 Query Optimizer?

Apr 22, 2004

I'm looking for an in depth book, article, faq, whatever, regarding the query optimizer...

I've read the books online pretty thoroughly and have been sql coding for a number of years. The system I work on relies heavily on real time access to data and the number crunching procedures we use are a critical part of the design. For the most part, sometimes through trial and error, I have been able to find ways to achieve the performance we need, but I'm often surprised by the methods that prove most effective.

For example, I have cases where I can only get the performance I'm looking for using table functions, and other cases where indexed temporary tables are the only way. I have statements that run fast as a select statement, but when converted to an update statement limp along, forcing me to resort to cursors, temp tables, or table hints with varying degrees of success.

I'm wondering if anyone has come across material that takes an in depth look at the various technologies available and how to tweek queries. I want to get away from hours of testing and hacking.

Thanks for reading. All replies are appreciated.

View 3 Replies View Related

Reading Query Optimizer

Jul 6, 1999

I am running a query showplan on a query. Can someone tell me how
to read what I am seeing? Or where I can get this information.

Thanks in advance,
Dianne

View 2 Replies View Related

Reason To Use Optimizer Hints

Aug 5, 1999

While investigating performance problems within an application recently I carried out some tests using SET SHOWPLAN ON.

I had a query like this within a stored procedure:

SELECT MAX(X) FROM Y WHERE Z LIKE @MYVAR

Where @MYVAR was passed in. I discovered that SQL Server did a Table Scan even when Z had an index on it. A problem with 200,000 rows!

If I said

SELECT MAX(X) FROM Y WHERE Z LIKE 'HELLO%'

(i.e., used a constant instead of a variable) SQL Server did use the index correctly and did not do a table scan.

I got around this by rewriting my statement:

SELECT MAX(X) FROM Y (INDEX=MYINDEX) WHERE Z LIKE @MYVAR

in other words by manually specifying the index I had created on the Z column.

Hope this helps someone.

View 2 Replies View Related

Query Optimizer For Sql 2005

Feb 5, 2008

One quick question.

Is query optimizer a tool in sql that optimizes your queries? If so how do you use it?

Thanks

View 1 Replies View Related

MS SQL 2005: Where Clause And Optimizer

Feb 1, 2007

Way back when, and at least in version 7 IIRC, the query optimizer gaveup when the where clause in a statement contained more than 4 searchconditions.Does anyone know if such a limitation still exist in MS SQL 2005? TheBOL seems to be silent on the issue.Boa

View 2 Replies View Related

Does Using Isnull() Prevent The Optimizer From Using The Index For That Col.?

Apr 3, 2001

Hi all,
This table,

create table test (
t1 int,
t2 char(4) )

has about a few hundred rows. I have created a nonclustered index on column t1.

When I execute the following query, the query execution plan shows that the optimizer performs an index seek using the index on col. t1.

select * from test where t1 = 4

But, when I run the following query, using isnull(), the optimizer always performs a table scan.

select * from test where isnull(t1, 0) = 4

Could someone please explain why?

Thanks in advance,
Praveena

View 1 Replies View Related

SQL 2012 :: How To Determine When A Statistic Was Last Used By The Optimizer

Aug 25, 2015

Is there a DMV or similar in SQL 2012, or SQL 2008, that shows when a statistic was last used by the optimizer? I would like to cleanup some of the auto-generated stats, assuming it's possible to do so. In particular I'm looking to drop those statistics that were created by one-off queries, data loads, etc, and are now doing nothing but adding to the execution time of Update Statistics jobs.

View 6 Replies View Related

Why Optimizer Is Not Smart? Is Dynamic SQL My Only Option...

Feb 8, 2007

declare @ContactId as integerset @ContactId = 5select *from Person.Contactwhere ContactId = @ContactIdOR @ContactId = -1If you run this in SQL 2005 on the AdventureWorks database,why the logical reads is 561Table 'Contact'. Scan count 1, logical reads 56and not 2 when you run without the second OR condition:declare @ContactId as integerset @ContactId = 5select *from Person.Contactwhere ContactId = @ContactIdHow can i use the same SP and either get one record returnedby passing the ID of the field, or pass a dummy parameter like-1 in order to get ALL the records returned.In this case even when i pass a parameter like ContactID = 5there is still a table scan (clustered index scan in this case)happening for the other OR condition.There's no method to tell SQL to start checking the first conditionwhether or not it is true then if it is false then check the second ORconditon. On the same topic does this mean all OR conditions areALWAYS verified regardless if one of them has already been determinedto be True?Thank you

View 2 Replies View Related

Optimizer Logic Tracing Tool

Jul 20, 2005

Guys,what I need is a tool which gives details on the choice of anexecution plan by the SQL Server. For example, the cost for a hashjoin might be 200 and 100 for a nested loop, and therefore a nestedloop is used. Same thing for the access paths for each table/viewinvolved. In Oracle, we turn on event 100053 to see this kind of info.ThanxDaniel

View 2 Replies View Related

Query Optimizer Does Not Use The Index I Expect

Jun 27, 2007

I am trying to resolve performance issues in a third party application. I have run the profiler and found a transaction that performs a table scan against a 6 million row table. This transaction occurs repeatedly, so I thought, just add an index on the columns in the where clause used here. After adding the index, I looked at the estimated execution plan in Query analyzer, and I find that it is still performing the table scan. If I run the query it takes over 60 seconds to run, if i add an index hint, it runs in under a second. I ran DBCC SHOW_STATISTICS to see if the statistics were up to date:

Statistics for INDEX 'IX_Finish_dept'.
Updated Rows Rows Sampled Steps Density Average key length
-------------------- -------------------- -------------------- ------ ------------------------ ------------------------
Jun 26 2007 5:18PM 6832336 6832336 150 2.1415579E-7 18.0

(1 row(s) affected)

All density Average Length Columns
------------------------ ------------------------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2.1875491E-7 8.0 finish
1.9796084E-7 18.0 finish, dept

(2 row(s) affected)

RANGE_HI_KEY RANGE_ROWS EQ_ROWS DISTINCT_RANGE_ROWS AVG_RANGE_ROWS
------------------------------------------------------ ------------------------ ------------------------ -------------------- ------------------------
1900-01-01 00:00:00.000 0.0 106110.0 0 0.0
2001-02-01 17:00:00.000 54121.0 47.0 22951 2.3581107
2001-02-28 17:00:00.000 44436.0 22.0 18121 2.4520473
2001-04-06 00:00:00.000 56830.0 76.0 24902 2.2820544
2001-08-10 17:00:00.000 196491.0 19.0 88800 2.2127116
2001-09-02 17:00:00.000 33070.0 50.0 15289 2.162993
2001-10-05 17:04:59.997 57975.0 30.0 22882 2.5335402
2001-11-05 15:31:59.997 50178.0 21.0 20899 2.4008613
2001-12-10 17:00:00.000 55266.0 38.0 25114 2.2006052
2002-01-03 17:00:00.000 40322.0 51.0 18649 2.1620376
2002-02-25 17:00:00.000 86338.0 24.0 39266 2.1987979
2002-08-15 06:11:00.000 296085.0 166.0 124526 2.3776772
2002-10-07 21:18:59.997 88727.0 826.0 39017 2.2740018
2002-12-17 16:59:00.000 127671.0 6.0 53314 2.3946545
2003-01-16 07:15:00.000 62206.0 71.0 24604 2.5281854
2003-01-21 07:15:00.000 8287.0 43.0 3661 2.2629712
2003-01-27 07:15:00.000 10402.0 68.0 4265 2.4389215
2003-01-31 07:15:00.000 9127.0 73.0 3784 2.4113607
2003-02-05 00:00:00.000 8362.0 327.0 3500 2.3891428
2003-02-10 00:00:00.000 8846.0 262.0 3230 2.7386997
2003-02-14 00:00:00.000 10018.0 51.0 4107 2.4386563
2003-02-20 00:00:00.000 10388.0 91.0 4686 2.2168159
2003-02-26 00:00:00.000 10571.0 69.0 4330 2.4407759
2003-03-03 00:00:00.000 10476.0 261.0 4423 2.3679929
2003-03-06 00:00:00.000 8858.0 594.0 3183 2.7829092
2003-04-02 00:00:00.000 57681.0 275.0 38622 1.4934366
2003-04-05 00:00:00.000 10539.0 29.0 8776 1.2008888
2003-04-09 00:00:00.000 9880.0 1324.0 7193 1.3735576
2003-04-12 00:00:00.000 8953.0 195.0 7737 1.1571668
2003-04-16 00:00:00.000 8385.0 177.0 7154 1.1719078
2003-04-21 00:00:00.000 8920.0 173.0 7756 1.1500773
2003-04-24 00:00:00.000 8563.0 156.0 7320 1.169649
2003-04-29 00:00:00.000 8462.0 137.0 7414 1.1412003
2003-05-02 00:00:00.000 9625.0 140.0 8363 1.1509027
2003-05-06 00:00:00.000 8208.0 904.0 6557 1.251792
2003-05-09 00:00:00.000 9211.0 119.0 7986 1.1533934
2003-05-19 00:00:00.000 19623.0 123.0 17290 1.1348679
2003-05-22 00:00:00.000 9568.0 246.0 8357 1.1449084
2003-05-28 00:00:00.000 9599.0 169.0 8553 1.1221651
2003-06-02 00:00:00.000 10937.0 174.0 9599 1.1393895
2003-07-11 00:00:00.000 99592.0 999.0 83573 1.1916767
2003-07-29 00:00:00.000 42434.0 111.0 33918 1.2510761
2003-08-21 00:00:00.000 59580.0 323.0 50756 1.1738282
2003-09-12 00:00:00.000 51779.0 1407.0 44298 1.1688789
2003-09-25 00:00:00.000 30655.0 255.0 26924 1.138533
2003-10-12 00:00:00.000 44573.0 968.0 37746 1.1808668
2003-10-28 00:00:00.000 38358.0 532.0 32689 1.1734222
2003-11-11 00:00:00.000 35158.0 145.0 28124 1.2500622
2003-12-04 00:00:00.000 61304.0 787.0 52882 1.1592383
2003-12-18 00:00:00.000 44462.0 221.0 39493 1.1257913
2004-01-06 00:00:00.000 56617.0 998.0 49471 1.1444252
2004-02-04 00:00:00.000 96694.0 537.0 83182 1.162425
2004-03-05 00:00:00.000 90850.0 716.0 78693 1.1544864
2004-03-23 00:00:00.000 48969.0 125.0 43450 1.1270195
2004-07-05 00:00:00.000 301725.0 1405.0 258824 1.1657491
2004-08-06 00:00:00.000 95079.0 1419.0 75445 1.2602259
2004-09-03 00:00:00.000 88056.0 193.0 68403 1.2873119
2004-09-23 01:30:12.997 57515.0 8.0 42891 1.3409261
2004-10-11 00:00:00.000 57204.0 116.0 40241 1.4215
2004-10-15 00:00:00.000 17702.0 186.0 12774 1.3856752
2004-10-19 00:00:00.000 9556.0 125.0 7305 1.3079661
2004-10-21 00:00:00.000 8898.0 133.0 6299 1.4126052
2004-10-25 00:00:00.000 8878.0 104.0 6372 1.3930645
2004-10-27 00:00:00.000 11904.0 252.0 6056 1.9656539
2004-10-29 00:00:00.000 8866.0 99.0 6551 1.3533812
2004-11-02 15:22:47.997 12287.0 1.0 9791 1.2547998
2004-11-05 13:16:50.997 12287.0 1.0 10013 1.2269822
2004-11-09 23:52:48.000 12284.0 4.0 9200 1.3352174
2004-11-12 17:17:59.997 12287.0 1.0 9360 1.3127136
2004-11-22 06:58:06.997 24575.0 1.0 19742 1.244745
2004-11-25 01:57:00.000 12287.0 1.0 8822 1.392768
2004-11-30 21:34:59.997 12287.0 1.0 9128 1.3459306
2004-12-03 13:21:24.000 12287.0 1.0 9085 1.3523003
2004-12-07 04:05:21.000 12285.0 5.0 9488 1.2947934
2004-12-09 13:25:00.000 12285.0 5.0 8993 1.3659106
2004-12-13 07:21:46.000 12282.0 10.0 9461 1.2981714
2004-12-15 18:41:23.000 12287.0 2.0 9112 1.3482937
2005-02-04 14:41:36.997 178768.0 58.0 133439 1.3396883
2005-02-23 00:00:00.000 51107.0 29.0 38624 1.3231586
2005-03-10 23:06:17.997 50891.0 24.0 38479 1.3225312
2005-03-28 00:00:00.000 45509.0 32.0 34203 1.3305169
2005-04-13 09:50:34.000 58778.0 19.0 43687 1.3454038
2005-06-08 09:46:43.997 162983.0 25.0 121508 1.3413246
2005-08-08 09:37:29.000 197467.0 20.0 143462 1.3764411
2005-08-24 11:21:37.997 57393.0 5.0 42770 1.3418672
2005-09-11 13:54:05.997 53729.0 5.0 39527 1.3592987
2005-11-08 00:00:00.000 193537.0 69.0 136906 1.4136385
2005-11-22 00:00:00.000 55031.0 33.0 38197 1.4407152
2005-12-05 00:00:00.000 40371.0 77.0 28082 1.4376112
2005-12-22 12:40:59.997 75170.0 3.0 52523 1.4311825
2006-03-02 00:00:00.000 239709.0 42.0 170405 1.4066935
2006-03-04 06:26:36.997 9639.0 23.0 6470 1.489799
2006-03-12 10:02:43.000 21993.0 1.0 16086 1.3672137
2006-03-15 00:00:00.000 8774.0 40.0 6687 1.3119019
2006-04-03 00:00:00.000 69570.0 31.0 46495 1.4962578
2006-04-04 00:00:00.000 8743.0 28.0 4606 1.8977643
2006-04-04 13:53:00.997 12284.0 6.0 3401 3.6108172
2006-04-05 00:00:00.000 10794.0 29.0 3438 3.139616
2006-04-06 00:00:00.000 9413.0 45.0 5001 1.8818473
2006-04-10 00:00:00.000 11058.0 30.0 7865 1.4059758
2006-04-14 00:00:00.000 23183.0 38.0 16281 1.4238423
2006-04-18 00:00:00.000 9898.0 37.0 7258 1.3635488
2006-04-21 03:19:31.000 16561.0 26.0 11848 1.3976707
2006-04-25 14:48:00.000 12287.0 3.0 8553 1.436572
2006-04-27 13:37:49.000 9793.0 96.0 7203 1.3593837
2006-05-02 00:00:00.000 11426.0 30.0 8135 1.4043757
2006-05-04 05:28:36.000 12277.0 22.0 8806 1.3940048
2006-06-08 00:00:00.000 123695.0 33.0 89478 1.3824068
2006-06-16 00:00:00.000 35327.0 37.0 24539 1.4396267
2006-06-29 00:00:00.000 48433.0 40.0 35226 1.3748829
2006-07-14 00:00:00.000 62915.0 57.0 44859 1.4024744
2006-08-10 00:00:00.000 106281.0 36.0 75810 1.401939
2006-08-17 00:00:00.000 25345.0 81.0 18123 1.398422
2006-08-28 00:00:00.000 40947.0 38.0 27573 1.4850397
2006-09-11 09:00:00.000 52187.0 15913.0 36698 1.4220666
2006-09-25 00:00:00.000 52902.0 30.0 37210 1.4216764
2006-10-06 00:00:00.000 54534.0 31.0 38244 1.4259119
2006-10-11 13:29:40.997 16380.0 5.0 12503 1.3100855
2006-11-29 00:00:00.000 197522.0 27.0 138746 1.423623
2006-12-01 00:00:00.000 10584.0 24.0 7602 1.3920821
2007-01-02 00:00:00.000 141284.0 34.0 101246 1.3954526
2007-01-12 02:57:03.997 60416.0 23.0 41700 1.4488249
2007-02-13 00:00:00.000 156270.0 75.0 109875 1.4222525
2007-02-16 00:00:00.000 17770.0 38.0 12325 1.441668
2007-03-05 12:23:00.000 73763.0 3.0 51503 1.43218
2007-03-08 04:11:49.997 16407.0 22.0 11428 1.4355587
2007-03-26 09:10:43.000 76336.0 20.0 53687 1.4218712
2007-04-05 12:31:28.000 64126.0 24.0 40172 1.5962859
2007-04-07 01:11:22.000 9244.0 28.0 6657 1.388405
2007-04-10 00:00:00.000 8924.0 38.0 6140 1.4531835
2007-04-24 21:01:00.000 73487.0 6.0 51689 1.421687
2007-04-26 09:01:48.997 9584.0 25.0 6650 1.441203
2007-04-28 04:09:21.000 9801.0 27.0 7037 1.3925831
2007-05-01 12:55:00.000 8781.0 26.0 6012 1.460336
2007-05-03 00:00:00.000 10570.0 53.0 7298 1.4481436
2007-05-04 21:49:27.000 12287.0 1.0 8680 1.415553
2007-05-08 06:06:45.997 8202.0 27.0 5511 1.4880261
2007-05-10 00:00:00.000 10920.0 49.0 7973 1.3696225
2007-05-12 00:44:10.000 11375.0 27.0 8223 1.3833151
2007-05-15 10:51:50.000 9453.0 27.0 6516 1.4507366
2007-05-18 08:44:36.997 17930.0 27.0 12651 1.4172792
2007-05-22 00:00:00.000 10089.0 74.0 7260 1.3894781
2007-05-23 21:07:38.000 12286.0 3.0 8604 1.4279405
2007-05-26 03:46:02.000 12287.0 6.0 8545 1.4377487
2007-05-30 21:24:29.997 12287.0 1.0 8663 1.4183308
2007-06-01 18:37:16.000 12287.0 1.0 8401 1.4623899
2007-06-05 00:00:00.000 9255.0 52.0 6491 1.4256008
2007-06-08 22:18:40.000 24574.0 3.0 17047 1.4415439
2007-06-12 09:42:14.997 9550.0 31.0 6410 1.4896272
9200-12-08 09:49:59.997 64286.0 1.0 45408 1.4157417

(150 row(s) affected)

What can I do to get SQL to use this index?

View 4 Replies View Related

Indexed View Not Used By The Query Optimizer

Aug 20, 2007

Hello All,
I have a series of Stored Procedure that has a query taking a join of 5 tables. These tables are quiet large with couple of them having around 10 million rows. As this is a DSS application having periodic data loads, I thought of creating Indexed View on top of these tables. Now the problem is that the Indexed View is not directly used by the optimizer. I need to change my queries and put a WITH (NOEXPAND) query hint to make sure the indexed views are used. This is inspite getting dramatic improvement in the query timings (from 64 secs down to 3 secs) after using the Indexed Views. I would like to know what can be the possible reason for the optimizer not using the Indexed View by itself. Is it because my Indexed View caters to multiple queries or I am missing out on something basic.

Thanks in Advance,
Mitesh Shah

View 4 Replies View Related

NOLOCK Optimizer Hint On Iterator

Oct 25, 2006

An interesting discussion yesterday. One of the programmers asked about the use of the NOLOCK optimizer hint with an iterator table aka table of numbers. His comment was that this optimizer hint was not efficient. Rather than give a knee-jerk response I thought it would be better to ask. The main circumstance is that the iterator table is completely static with a fill factor of 100%. My purpose is to eliminate lock contention if I can.

Are there reasons to not use the NOLOCK hint in this case to potentially improve performance?





Dave

View 6 Replies View Related

Keep A Multi-valued Parameter Cleared From Selections Until The User Select His Choice

Apr 28, 2008

I have a report that includes two multi-valued parameters.
In the Default Values section, I choose 'from query' and select dataset and value field.
In the Available Values section, I choose 'from query' select the same dataset and value field, and in the label field I select the relevant label field.
When I run the report my multi-valued parameters look like I selected the option 'select all' (all options are selected).
How can I keep the multi-valued parameters cleared from selections until the user select his choice? Thanks in advance.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved