Viewing 15 posts - 3,586 through 3,600 (of 10,144 total)
A significant number of implicit conversions are interfering with optimisation of this query. Here's a few recommendations to start with:
Cast @YearFrom and @YearTo to same datatype as BRFCLSeaWeekHis.Year
Cast @QuoteType...
March 3, 2014 at 1:57 am
Thanks.
Try placing the nonclustered index keys the other way around:
CREATE NONCLUSTERED INDEX [IX_BRFCLSeaWeekHis_QuoteType] ON [dbo].[BRFCLSeaWeekHis]
(
Year, [QuoteType] ASC
)
INCLUDE (
[CurrencyCode],
[RateTotal],
[SeaTotal],
[Total])
February 28, 2014 at 9:28 am
Any time Dale.
Check out the two APPLY articles by Paul White in my signature too, they are an excellent walkthrough with examples.
February 28, 2014 at 8:43 am
mark.kristensen (2/28/2014)
I have attached a file to the first post - is that what you need or if not, then please tell me how to get it 🙂
Execution plan with...
February 28, 2014 at 8:31 am
mark.kristensen (2/28/2014)
Thanks for the leads, but even with recompile and changed index, the time is the same.
In relation to your first post, then I will not likely get anymore...
February 28, 2014 at 7:49 am
From an earlier post: "Here's a table of the possible combinations of specialties and capabilities (the 'YES' column should be ignored):"
Do you have a table which looks similar to what...
February 28, 2014 at 7:01 am
For a quick win, change your non-clustered index like so:
CREATE NONCLUSTERED INDEX [IX_BRFCLSeaWeekHis_QuoteType] ON [dbo].[BRFCLSeaWeekHis]
(
[QuoteType] ASC, Year
)
INCLUDE (
[CurrencyCode],
[RateTotal],
[SeaTotal],
[Total])
and your query like so:
WHERE QuoteType = @QuoteType
AND FCL.Year >=...
February 28, 2014 at 6:49 am
Hi Mark
Two or three points to consider.
Firstly this is a "Catch-all query". In a nutshell, the number of rows returned could vary dramatically depending upon the parameters passed in....
February 28, 2014 at 6:45 am
Dale Magnant (2/27/2014)
...(By the way, the last line of query assigned an alias of 'x', I assume you meant 'p' and changed the line accordingly.)
Yep, sorry, my mistake.
Dale Magnant (2/27/2014)
After...
February 28, 2014 at 1:57 am
UPDATE m Set
POObligations = x.POObligations
FROM MDEP m
CROSS APPLY (
SELECT
POObligations = (SUM(PO_DX.QuantityOrdered * PO_DX.Price) - SUM(Distinct PO_MX.PaymentPosted))
* SUM(Distinct(cast(PO_MX.PrimarySplit as decimal(5,2))/100))
FROM PO_MX
INNER JOIN PO_DX
ON PO_DX.PONumber = PO_MX.PONumber
WHERE PO_MX.MDEP...
February 27, 2014 at 1:59 am
Please post the actual execution plan as a .sqlplan file attachment.
February 27, 2014 at 1:47 am
It sounds as if this is in the design phase - if this is the case, then consider pivoting the table you display here as your starting point, so columns...
February 26, 2014 at 6:43 am
Luis Cazares (2/25/2014)
Chris M already gave a solution, but with no DDL and sample data, I'm not giving an example.
It's not possible to give a good example without table aliases...
February 26, 2014 at 2:24 am
Two excellent articles by Paul White covering APPLY are linked in my sig.
If you take a closer look at the SELECT query I wrote, it's designed to show the update...
February 26, 2014 at 2:02 am
Stefan Krzywicki (2/25/2014)
The Dixie Flatline (2/25/2014)
rodjkidd (2/25/2014)
Steve Jones - SSC Editor (2/24/2014)
I went to the Rock and Roll Hall of Fame in Cleveland a few weeks ago. It was pretty...
February 26, 2014 at 1:52 am
Viewing 15 posts - 3,586 through 3,600 (of 10,144 total)