 |
|
 |
|
Next: Dimensional Modelling
|
| Author |
Message |
External

Since: Jan 29, 2008 Posts: 1
|
(Msg. 1) Posted: Tue Jan 29, 2008 1:51 pm
Post subject: Speed issue with a query on a large Dataset (Help needed) Archived from groups: microsoft>public>sqlserver>datawarehouse (more info?)
|
|
|
I have a Staging table with 29401560 records in it. No Indexes on this table
as it is the table loaded from my SSIS. I am performing an update on it using
the following query.
Update t1
Set
t1.PolicyID = t2.PolicyID
,t1.ValidStartDate = @StartDateTime
,t1.PolicyExt = Substring(t1.Policy,10,1)
From
[Staging].[dbo].[FCIAPLCYLogKey] t1
Left Join
[Policy].[dbo].[sprPolicy] t2
On
t2.PolicyNum = Left(t1.Policy,9)
The [sprPolicy] table is indexed. My problem is this query runs for over 30
minutes everytime and I need it to be under 10 minutes. Any suggestions would
be greatly appreciated. >> Stay informed about: Speed issue with a query on a large Dataset (Help needed) |
|
| Back to top |
|
 |  |
External

Since: Jan 14, 2008 Posts: 69
|
(Msg. 2) Posted: Sun Feb 03, 2008 9:47 am
Post subject: Re: Speed issue with a query on a large Dataset (Help needed) [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
well... doing 1 large update is not recommended.
you can do a loop of small batch instead-of 1 big (you can find a lot of
articles about this)
also, from what I see, you "t2.PolicyNum = Left(t1.Policy,9) " can break the
performance.
SQL Server can't use any index on this.
If you add a column "Policy9" in the staging table which contains the 9
characters to compare, then SQL Server can index this and improve the
performance. (add this column in the staging and change your SSIS package to
do the transformation)
but if you can do this during your loading instead-of an update, the
performance will be far better.
Sometimes, if you execute the query and load it into another table the
performance is better than doing an update.
the best way is to do this join in the current loading process in the
dataflow which insert the rows into the table, do the join here, everything
will be applied in "1 step"
good luck.
"Wildlife" wrote in message
> I have a Staging table with 29401560 records in it. No Indexes on this
> table
> as it is the table loaded from my SSIS. I am performing an update on it
> using
> the following query.
>
> Update t1
> Set
> t1.PolicyID = t2.PolicyID
> ,t1.ValidStartDate = @StartDateTime
> ,t1.PolicyExt = Substring(t1.Policy,10,1)
> From
> [Staging].[dbo].[FCIAPLCYLogKey] t1
> Left Join
> [Policy].[dbo].[sprPolicy] t2
> On
> t2.PolicyNum = Left(t1.Policy,9)
>
> The [sprPolicy] table is indexed. My problem is this query runs for over
> 30
> minutes everytime and I need it to be under 10 minutes. Any suggestions
> would
> be greatly appreciated.
> >> Stay informed about: Speed issue with a query on a large Dataset (Help needed) |
|
| Back to top |
|
 |  |
External

Since: Jan 14, 2008 Posts: 55
|
(Msg. 3) Posted: Thu Feb 14, 2008 6:30 pm
Post subject: Re: Speed issue with a query on a large Dataset (Help needed) [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
If you're doing this in SSIS, in your update task choose the option to
commit every 1000 or whatever number of records depending on the length of
your table.
Also, research sql server update hotspots or update hotspots for more info
--
Sincerely,
John K
Knowledgy Consulting
www.knowledgy.org
Atlanta's Business Intelligence and Data Warehouse Experts
"Wildlife" wrote in message
>I have a Staging table with 29401560 records in it. No Indexes on this
>table
> as it is the table loaded from my SSIS. I am performing an update on it
> using
> the following query.
>
> Update t1
> Set
> t1.PolicyID = t2.PolicyID
> ,t1.ValidStartDate = @StartDateTime
> ,t1.PolicyExt = Substring(t1.Policy,10,1)
> From
> [Staging].[dbo].[FCIAPLCYLogKey] t1
> Left Join
> [Policy].[dbo].[sprPolicy] t2
> On
> t2.PolicyNum = Left(t1.Policy,9)
>
> The [sprPolicy] table is indexed. My problem is this query runs for over
> 30
> minutes everytime and I need it to be under 10 minutes. Any suggestions
> would
> be greatly appreciated.
> >> Stay informed about: Speed issue with a query on a large Dataset (Help needed) |
|
| Back to top |
|
 |  |
External

Since: Jan 11, 2008 Posts: 46
|
(Msg. 4) Posted: Sat Feb 16, 2008 4:58 pm
Post subject: Re: Speed issue with a query on a large Dataset (Help needed) [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
If you look at the Execution Plan is it an Index Scan or seek on the Left
Join?
--
Jack Vamvas
___________________________________
Search IT jobs from multiple sources- http://www.ITjobfeed.com
"Wildlife" wrote in message
>I have a Staging table with 29401560 records in it. No Indexes on this
>table
> as it is the table loaded from my SSIS. I am performing an update on it
> using
> the following query.
>
> Update t1
> Set
> t1.PolicyID = t2.PolicyID
> ,t1.ValidStartDate = @StartDateTime
> ,t1.PolicyExt = Substring(t1.Policy,10,1)
> From
> [Staging].[dbo].[FCIAPLCYLogKey] t1
> Left Join
> [Policy].[dbo].[sprPolicy] t2
> On
> t2.PolicyNum = Left(t1.Policy,9)
>
> The [sprPolicy] table is indexed. My problem is this query runs for over
> 30
> minutes everytime and I need it to be under 10 minutes. Any suggestions
> would
> be greatly appreciated.
> >> Stay informed about: Speed issue with a query on a large Dataset (Help needed) |
|
| Back to top |
|
 |  |
| Related Topics: | SQL Scheduled Jobs - Is there a way to monitor schedule jobs and restart the jobs automatically when it faills and if it fails then notify the responsible person, is there a tool to do this ?
Running total with "treshold value" detection..? - Hi, I have to create a query which evalaute, for each year, the employees who reached a particular number of absences and when this value is reached. I have 1 000 000 records in my absence table. my table is like this: DateID, EmployeeID, ActivityID,...
Problem with multiple instant of SQL Server - I have 2 instant of SQL server on the same machine. 1st instant keep most of the static information - Dimensional data 2nd instant keep most of the transaction information. When I try to use the Analysis Services, I have 2 connection, but they can't ..
Near Real time updating of fact table - -what is the best method that to implement the near real time updating of a fact table without affecting all those users who are reading from it? -fact table in question is only 1.8gb in size, 3.1 million rows, expect near real time updating of approx....
Extraction software - Hi, I need an extraction software that needs to be capable of capturing a table (or tables) displayed on the web and converting it to a file as a list of records with comma separated values. The records will be converted to insert commands after the.... |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|
 |
|
|