 |
|
 |
|
Next: tabublation in Text field
|
| 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: Apr 17, 2006 Posts: 184
|
(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 03, 2008 Posts: 56
|
(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: Aug 13, 2007 Posts: 60
|
(Msg. 4) Posted: Sat Feb 16, 2008 3:00 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: | MDX Query - Help needed from experienced - Ingen ===== GA - Georgia --County1 --- SharedFlag --County2 --- SharedFlag NC - North Carolina --County1 --- SharedFlag --County2 --- SharedFlag MD - Maryland --County1 --- SharedFlag --County2 --- SharedFlag Query 1: Select Non Empty..
How to Speed Up Data synchronization - We have 3 database, A, B & C in Server X and D in Server Y. A contains data production 2003 B contains data production 2004 C contains current data production (2005) D contains all data from A, B & C A, B, C used for transaction, D used for repor...
can ommiting log file speed up me and how - Dear friends, I have a database with simple stucture and tasks but big data sizes (23M rec, 35G data file). Most of my data are static and I dn't need transaction facilities. so I set it to simple mode. The log file is created and has good size. How..
SSAS: full retrieval help with speed - I am writing a project which must pull all the data from a cube: rollups in a hierarchy, some attribute rollups, some time aggregates etc. and it is not a fast process. Currently I'm using C# and the adomdDataReader and an AdomdCommand objects to..
Very large dimensions - Looking at examples in Adventure Works and the Kimball equivalent client dimensions are at an individual account level. How realistic is this for very large account dimensions on order of 30 - 50 million accounts? Obviously this was not feasible in.... |
|
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
|
|
|
|
 |
|
|