I can't figure out why i have a bookmark lookup cost on ValidVendorPackages
on the below proc:
Select PriceViewHotelPrice.price as Totalprice, PriceViewHotelPrice.Docid
from price_view PriceViewHotelPrice Inner Join
(
select C1.Priceid as Pid,C1.VendorPackageId from
(
select distinct(HA.PriceId), HA.VendorPackageId from Criteria HA Inner Join
(
select VendorPackageId from ValidVendorPackages
where (Vendor = @.Vendor or @.Vendor = '')
and (Sitecode = @.Sitecode or @.Sitecode = '')
and (PackageType = @.PackageType or @.PackageType = '')
and (RequiredItems = @.RequiredItems or @.RequiredItems = -1)
)HB on HA.VendorPackageId = HB.VendorPackageId
and
(
CriteriaId in
(
select CriteriaID from ValidItemCriteria
where Destination = @.Destination
and LengthOfStay = @.LengthOfStay
and Ages = @.Ages
and ComponentType = 'H'
and (ValidItemType = @.HotelValidItemType_1 or @.HotelValidItemType_1 = '' )
and (ItemValue = @.HotelItemValue_1 or @.HotelItemValue_1 = '' )
)
)
) C1
) HotelCriteriaPriceId on PriceViewHotelPrice.priceid =
HotelCriteriaPriceId.Pid
and PriceViewHotelPrice.keydate between @.KeyDateMin and @.KeyDateMax
and ((PriceViewHotelPrice.price) between @.PriceLow and @.PriceHigh or
@.PriceLow = -1)
and (PriceViewHotelPrice.Volatility between @.VolatilityMin and
@.VolatilityMax or @.VolatilityMin = -1)
and (PriceViewHotelPrice.AvgMinsUpdateInterval between
@.AvgMinsUpdateIntervalMin and @.AvgMinsUpdateIntervalMax or
@.AvgMinsUpdateIntervalMin = -1)
Order by TotalPrice
can anyone see why?
will
On Wed, 15 Dec 2004 11:55:04 -0800, we7313 wrote:
>I can't figure out why i have a bookmark lookup cost on ValidVendorPackages
>on the below proc:
Hi we7313,
Without knowing your table structure, indexes, etc, I can't do anything
but guess. Peruse at your own risk :-)
Looking at this part of the query:
>select distinct(HA.PriceId), HA.VendorPackageId from Criteria HA Inner Join
>(
>select VendorPackageId from ValidVendorPackages
>where (Vendor = @.Vendor or @.Vendor = '')
>and (Sitecode = @.Sitecode or @.Sitecode = '')
>and (PackageType = @.PackageType or @.PackageType = '')
>and (RequiredItems = @.RequiredItems or @.RequiredItems = -1)
>)HB on HA.VendorPackageId = HB.VendorPackageId
>and
>(
>CriteriaId in
>(
>select CriteriaID from ValidItemCriteria
>where Destination = @.Destination
>and LengthOfStay = @.LengthOfStay
>and Ages = @.Ages
>and ComponentType = 'H'
>and (ValidItemType = @.HotelValidItemType_1 or @.HotelValidItemType_1 = '' )
>and (ItemValue = @.HotelItemValue_1 or @.HotelItemValue_1 = '' )
>)
>)
I think that the optimizer has decided to start with reducing the number
of matching rows in Criteria by checking the CriteriaId in (...)
condition. Criteria rows that match are then used in the join against
ValidVendorPackages (note: the derived table is easily transformed in a
simple join; the optimizer will probably execute it as a simple join).
Obviously, you have a nonclustered index on the column VendorPackageId in
ValidVendorPackages. In order to check the other conditions (on Vendor,
Sitecode, PackageType and RequiredItems) as well, SQL Server has to fetch
the complete row. The nonclustered index used to find the VendorPackageId
will also contain the values for the clustered index on this table: they
serve as a pointer to the complete row. SQL Server will now take these
values and use them to navigate the clustered index down to the row that
corresponds to the index entry. This action (using the clustered index
values stored in the nonclustered index to find the row) is called a
bookmark lookup.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
Showing posts with label cant. Show all posts
Showing posts with label cant. Show all posts
Thursday, March 22, 2012
Bookmark lookup (Why)
Labels:
below,
bookmark,
cant,
cost,
database,
figure,
lookup,
microsoft,
mysql,
oracle,
price,
priceviewhotelprice,
procselect,
server,
sql,
totalprice,
validvendorpackageson
Monday, March 19, 2012
Blowing my mind!
Ok gurus here is somethign that I cant explane. I am haveing serious eratic responses from my SQL 7.0 Server. I can take a stored procedure and run it in a query analyzer window and it works fine, I go to rerun the same code in that window a second time and get no return set. The temp table is null. open a new window and it works fine. This code rand like clock work two weeks ago and there have been no updates to the code. I am on an old server wich has given me many hardware head aches in the past....am I having a hardware falure or is this a SQL issue?
JimRE:
I am haveing serious eratic responses from my SQL 7.0 Server. I can take a stored procedure and run it in a query analyzer window and it works fine, I go to rerun the same code in that window a second time and get no return set. The temp table is null. open a new window and it works fine. This code ran like clock work two weeks ago and there have been no updates to the code. I am on an old server wich has given me many hardware head aches in the past....
Q1 Am I having a hardware falure or is this a SQL issue? Jim
A1 From the information / background given, it may be a resource stressed sql server, sick / dying hardware, connectivity issues, possibly workstation issues, or worse, some combination of ills. It may be helpful to characterize the issue further in multiple ways, e.g.(test for the issue from other workstations, monitor with profiler, check server array and other hardware health, etc., etc., etc.).|||Originally posted by DBA
A1 From the information / background given, it may be a resource stressed sql server, sick / dying hardware, connectivity issues, possibly workstation issues, or worse, some combination of ills. It may be helpful to characterize the issue further in multiple ways, e.g.(test for the issue from other workstations, monitor with profiler, check server array and other hardware health, etc., etc., etc.).
the network admin isnt willing to test the box, he says it sql
the problem persists on multiple workstations, this is quad processer with 4 gig of ram and the resorce monitor says that the processors and mem are not near maxed out.........I think I may have some courupt indexes. I had a maintenance plan boom on me in the middle of this db and I think that hurt my indexes. Is that something that can happen?
Jim
PS Fixed the above mentioned stored procedure now just haveing horendious respons time
Jim|||RE:
the network admin isnt willing to test the box, he says it sql
My that's helpful, what if it is actually both?
RE:
Q1 the problem persists on multiple workstations, this is quad processer with 4 gig of ram and the resorce monitor says that the processors and mem are not near maxed out.........I think I may have some courupt indexes. I had a maintenance plan boom on me in the middle of this db and I think that hurt my indexes. Is that something that can happen? Jim PS Fixed the above mentioned stored procedure now just haveing horendious respons time Jim
A1 Consider running dbcc checkdb; them repair (or drop / recreate) any corrupt indicies found. Corrupting indicies would depend on the nature of "boom". Corrupt indexes may account for long response times.|||Originally posted by DBA
My that's helpful, what if it is actually both?
A1 Consider running dbcc checkdb; them repair (or drop / recreate) any corrupt indicies found. Corrupting indicies would depend on the nature of "boom". Corrupt indexes may account for long response times.
Running dbcc checkdb now...can you give me a guess to how long it will run on a 60ish gig db?
Jim|||Originally posted by JDionne
Q1 Running dbcc checkdb now...can you give me a guess to how long it will run on a 60ish gig db?
Jim
A1 Wouldn't want to hazard a guess (depends on to many variables specific to the environment such as disk access rates, how much corruption exists, number of indexes, etc., etc., etc.).
It is possible to get an estimate of how much tempdb space may be required to checkalloc and chekctables via:
dbcc checkdb With EstimateOnly
Hopefully some of this was helpful (any hardware / corruption or other issues identified)?|||Originally posted by DBA
A1 Wouldn't want to hazard a guess (depends on to many variables specific to the environment such as disk access rates, how much corruption exists, number of indexes, etc., etc., etc.).
It is possible to get an estimate of how much tempdb space may be required to checkalloc and chekctables via:
dbcc checkdb With EstimateOnly
Hopefully some of this was helpful (any hardware / corruption or other issues identified)?
as of now the checkdb showed no errors, and there supposidly is no hardware problems...we have rebuilt a few tables and indexes and It seems to be a bit better...rewriten known code a diff way and that has seemed to help a bit to. We also found a corupt data load file and we are hopeing to get that fixed soon. Thanx for your help...It has been invaluable.
Jim
JimRE:
I am haveing serious eratic responses from my SQL 7.0 Server. I can take a stored procedure and run it in a query analyzer window and it works fine, I go to rerun the same code in that window a second time and get no return set. The temp table is null. open a new window and it works fine. This code ran like clock work two weeks ago and there have been no updates to the code. I am on an old server wich has given me many hardware head aches in the past....
Q1 Am I having a hardware falure or is this a SQL issue? Jim
A1 From the information / background given, it may be a resource stressed sql server, sick / dying hardware, connectivity issues, possibly workstation issues, or worse, some combination of ills. It may be helpful to characterize the issue further in multiple ways, e.g.(test for the issue from other workstations, monitor with profiler, check server array and other hardware health, etc., etc., etc.).|||Originally posted by DBA
A1 From the information / background given, it may be a resource stressed sql server, sick / dying hardware, connectivity issues, possibly workstation issues, or worse, some combination of ills. It may be helpful to characterize the issue further in multiple ways, e.g.(test for the issue from other workstations, monitor with profiler, check server array and other hardware health, etc., etc., etc.).
the network admin isnt willing to test the box, he says it sql
the problem persists on multiple workstations, this is quad processer with 4 gig of ram and the resorce monitor says that the processors and mem are not near maxed out.........I think I may have some courupt indexes. I had a maintenance plan boom on me in the middle of this db and I think that hurt my indexes. Is that something that can happen?
Jim
PS Fixed the above mentioned stored procedure now just haveing horendious respons time
Jim|||RE:
the network admin isnt willing to test the box, he says it sql
My that's helpful, what if it is actually both?
RE:
Q1 the problem persists on multiple workstations, this is quad processer with 4 gig of ram and the resorce monitor says that the processors and mem are not near maxed out.........I think I may have some courupt indexes. I had a maintenance plan boom on me in the middle of this db and I think that hurt my indexes. Is that something that can happen? Jim PS Fixed the above mentioned stored procedure now just haveing horendious respons time Jim
A1 Consider running dbcc checkdb; them repair (or drop / recreate) any corrupt indicies found. Corrupting indicies would depend on the nature of "boom". Corrupt indexes may account for long response times.|||Originally posted by DBA
My that's helpful, what if it is actually both?
A1 Consider running dbcc checkdb; them repair (or drop / recreate) any corrupt indicies found. Corrupting indicies would depend on the nature of "boom". Corrupt indexes may account for long response times.
Running dbcc checkdb now...can you give me a guess to how long it will run on a 60ish gig db?
Jim|||Originally posted by JDionne
Q1 Running dbcc checkdb now...can you give me a guess to how long it will run on a 60ish gig db?
Jim
A1 Wouldn't want to hazard a guess (depends on to many variables specific to the environment such as disk access rates, how much corruption exists, number of indexes, etc., etc., etc.).
It is possible to get an estimate of how much tempdb space may be required to checkalloc and chekctables via:
dbcc checkdb With EstimateOnly
Hopefully some of this was helpful (any hardware / corruption or other issues identified)?|||Originally posted by DBA
A1 Wouldn't want to hazard a guess (depends on to many variables specific to the environment such as disk access rates, how much corruption exists, number of indexes, etc., etc., etc.).
It is possible to get an estimate of how much tempdb space may be required to checkalloc and chekctables via:
dbcc checkdb With EstimateOnly
Hopefully some of this was helpful (any hardware / corruption or other issues identified)?
as of now the checkdb showed no errors, and there supposidly is no hardware problems...we have rebuilt a few tables and indexes and It seems to be a bit better...rewriten known code a diff way and that has seemed to help a bit to. We also found a corupt data load file and we are hopeing to get that fixed soon. Thanx for your help...It has been invaluable.
Jim
blonde to write query or design fault
Dear All,
Im wondering if its the design that needs to be changed or I simply cant put this together.
I have 3 tables.
1. people (peopId, peopFName, peopSName etc.)
2. codes (codeId, codeName)
3. codedPeople(codePeopleId, peopId, codeId)
Codes represent different skills of people, example the sort of job functions theyve held in their employment. Like:
t-CEO,
t-CFO
t-Founder
etc.
people, clearly holds data about people.
CodedPeople holds data about which people are coded. So person1 can be coded as t-CEO as well t-Founder, and person2 coded as t-CFO
What I need is a query that returns all distinct people records and takes a number of codeNames as input. So if I throw in t-CEO OR t-Founder I get person1, again if I define t-CEO AND t-Founder I get person1.
However when I add t-CEO OR t-CFO I get person1 and person2 but when the query takes t-CEO AND t-CFO I get no result.
I cant seem to come up with anything that would give me a good starting point. Is there a design fault here? All opinions are much appreciated, thanks in advance!"the query takes t-CEO AND t-CFO I get no result."
Is that wrong? No person is t-CEO AND t-CFO in your example.
Please tell us what you want the result to be.|||Thanks for getting back!
Ok, so I have 3 codes and 2 people in the database. (In reality its about 250 different codes and about 10,000 people, growth is about 5000 / year)
I coded person1 as a technology-Chief Executive Officer and also as a technology-Founder (t-CFO, t-Founder)
I also coded person2 as a technology-Chief Financial Officer (t-CFO)
I want to write a query that takes codes as parameters:
t-CEO AND t-Founder = returns person1 (as hes coded as a t-CEO and t-Founder)
t-CEO OR t-CFO = returns person1 and person2 (as person1 is coded as t-CEO and person2 is coded as t-CFO)
t-CEO AND t-CFO = returns no result ( as no person in the db is coded as both a t-CEO and also a t-CFO)
t-CFO or t-Founder = returns person1 and person2 (as person1 is coded as a t-Founder and person2 is coded as a t-CFO)
Am I describing it correctly?
Of course the query need to be flexible as Ill using it from ASP.NET dropping in the parameters so codeName Like t-CEO OR codeName Like t-Founder
I have:
SELECT people.peopId, peopFName, peopSName, peopPhoneHome, peopPhoneMobile, peopEmail, codes.codeId, codename
FROM people INNER JOIN codedPeople ON people.peopId = codedPeople.peopId
INNER JOIN codes ON codes.codeId = codedPeople.codeId
WHERE ( ( codeName LIKE 't-CEO' ) OR ( codeName LIKE 't-CFO' ) )
ORDER BY peopSName, peopFName
But thats useless!|||Let me correct that, I have mixed up the similar codes of t-CEO and t-CFO, the correct one is:
Thanks for getting back!
Ok, so I have 3 codes and 2 people in the database. (In reality its about 250 different codes and about 10,000 people, growth is about 5000 / year)
I coded person1 as a technology-Chief Executive Officer and also as a technology-Founder (t-CEO, t-Founder)
I also coded person2 as a technology-Chief Financial Officer (t-CFO)
I want to write a query that takes codes as parameters:
t-CEO AND t-Founder = returns person1 (as hes coded as a t-CEO and t-Founder)
t-CEO OR t-CFO = returns person1 and person2 (as person1 is coded as t-CEO and person2 is coded as t-CFO)
t-CEO AND t-CFO = returns no result ( as no person in the db is coded as both a t-CEO and also a t-CFO)
t-CFO OR t-Founder = returns person1 and person2 (as person1 is coded as a t-Founder and person2 is coded as a t-CFO)
Am I describing it correctly?
Of course the query need to be flexible as Ill using it from ASP.NET dropping in the parameters so codeName Like t-CEO OR codeName Like t-Founder
I have:
SELECT people.peopId, peopFName, peopSName, peopPhoneHome, peopPhoneMobile, peopEmail, codes.codeId, codename
FROM people INNER JOIN codedPeople ON people.peopId = codedPeople.peopId
INNER JOIN codes ON codes.codeId = codedPeople.codeId
WHERE ( ( codeName LIKE 't-CEO' ) OR ( codeName LIKE 't-CFO' ) )
ORDER BY peopSName, peopFName
But thats useless!
Im wondering if its the design that needs to be changed or I simply cant put this together.
I have 3 tables.
1. people (peopId, peopFName, peopSName etc.)
2. codes (codeId, codeName)
3. codedPeople(codePeopleId, peopId, codeId)
Codes represent different skills of people, example the sort of job functions theyve held in their employment. Like:
t-CEO,
t-CFO
t-Founder
etc.
people, clearly holds data about people.
CodedPeople holds data about which people are coded. So person1 can be coded as t-CEO as well t-Founder, and person2 coded as t-CFO
What I need is a query that returns all distinct people records and takes a number of codeNames as input. So if I throw in t-CEO OR t-Founder I get person1, again if I define t-CEO AND t-Founder I get person1.
However when I add t-CEO OR t-CFO I get person1 and person2 but when the query takes t-CEO AND t-CFO I get no result.
I cant seem to come up with anything that would give me a good starting point. Is there a design fault here? All opinions are much appreciated, thanks in advance!"the query takes t-CEO AND t-CFO I get no result."
Is that wrong? No person is t-CEO AND t-CFO in your example.
Please tell us what you want the result to be.|||Thanks for getting back!
Ok, so I have 3 codes and 2 people in the database. (In reality its about 250 different codes and about 10,000 people, growth is about 5000 / year)
I coded person1 as a technology-Chief Executive Officer and also as a technology-Founder (t-CFO, t-Founder)
I also coded person2 as a technology-Chief Financial Officer (t-CFO)
I want to write a query that takes codes as parameters:
t-CEO AND t-Founder = returns person1 (as hes coded as a t-CEO and t-Founder)
t-CEO OR t-CFO = returns person1 and person2 (as person1 is coded as t-CEO and person2 is coded as t-CFO)
t-CEO AND t-CFO = returns no result ( as no person in the db is coded as both a t-CEO and also a t-CFO)
t-CFO or t-Founder = returns person1 and person2 (as person1 is coded as a t-Founder and person2 is coded as a t-CFO)
Am I describing it correctly?
Of course the query need to be flexible as Ill using it from ASP.NET dropping in the parameters so codeName Like t-CEO OR codeName Like t-Founder
I have:
SELECT people.peopId, peopFName, peopSName, peopPhoneHome, peopPhoneMobile, peopEmail, codes.codeId, codename
FROM people INNER JOIN codedPeople ON people.peopId = codedPeople.peopId
INNER JOIN codes ON codes.codeId = codedPeople.codeId
WHERE ( ( codeName LIKE 't-CEO' ) OR ( codeName LIKE 't-CFO' ) )
ORDER BY peopSName, peopFName
But thats useless!|||Let me correct that, I have mixed up the similar codes of t-CEO and t-CFO, the correct one is:
Thanks for getting back!
Ok, so I have 3 codes and 2 people in the database. (In reality its about 250 different codes and about 10,000 people, growth is about 5000 / year)
I coded person1 as a technology-Chief Executive Officer and also as a technology-Founder (t-CEO, t-Founder)
I also coded person2 as a technology-Chief Financial Officer (t-CFO)
I want to write a query that takes codes as parameters:
t-CEO AND t-Founder = returns person1 (as hes coded as a t-CEO and t-Founder)
t-CEO OR t-CFO = returns person1 and person2 (as person1 is coded as t-CEO and person2 is coded as t-CFO)
t-CEO AND t-CFO = returns no result ( as no person in the db is coded as both a t-CEO and also a t-CFO)
t-CFO OR t-Founder = returns person1 and person2 (as person1 is coded as a t-Founder and person2 is coded as a t-CFO)
Am I describing it correctly?
Of course the query need to be flexible as Ill using it from ASP.NET dropping in the parameters so codeName Like t-CEO OR codeName Like t-Founder
I have:
SELECT people.peopId, peopFName, peopSName, peopPhoneHome, peopPhoneMobile, peopEmail, codes.codeId, codename
FROM people INNER JOIN codedPeople ON people.peopId = codedPeople.peopId
INNER JOIN codes ON codes.codeId = codedPeople.codeId
WHERE ( ( codeName LIKE 't-CEO' ) OR ( codeName LIKE 't-CFO' ) )
ORDER BY peopSName, peopFName
But thats useless!
Saturday, February 25, 2012
blob field or memo field cant be used in formula field
I have a field with more then 250 size characters.When i add the field as Data base field , i can add and see the values.But i want to apply formula on the field to match the value of the field with other table field.
When i do so , i am getting "blob field or memo field can't be used in formula".
can any one suggest me a way to convert the memo field into text /string so i can compare with other field.
i tried with if (mid ({table.field),1,125} = table2.field)
but i am still getting the errorWithin the Crystal Reports formula editor, blog and image fields are not available. If you need to manipulate a text field that is more than 255 characters in length, or use the value in a large text field within a formula, you will need to do this outside of Crystal.
I suggest creating a stored procedure in your DB that returns all the field and/or portions of fields (substrings) you need for your report. Any parameters used by the report should also be included in the procedure. You might want to use the query Crystal has created for you existing report as a guide for created the Stored Proc.
Then create a report using the stored procedure as the data source. If stored procedures are not available as a data source, check your database options tab from the Crystal file menu->options
When i do so , i am getting "blob field or memo field can't be used in formula".
can any one suggest me a way to convert the memo field into text /string so i can compare with other field.
i tried with if (mid ({table.field),1,125} = table2.field)
but i am still getting the errorWithin the Crystal Reports formula editor, blog and image fields are not available. If you need to manipulate a text field that is more than 255 characters in length, or use the value in a large text field within a formula, you will need to do this outside of Crystal.
I suggest creating a stored procedure in your DB that returns all the field and/or portions of fields (substrings) you need for your report. Any parameters used by the report should also be included in the procedure. You might want to use the query Crystal has created for you existing report as a guide for created the Stored Proc.
Then create a report using the stored procedure as the data source. If stored procedures are not available as a data source, check your database options tab from the Crystal file menu->options
Friday, February 24, 2012
blank textarea
Hi,
I can't get a blank textarea when applying my .xslt to a .xml file. I know
this is a common error because I've already found some solutions but none
worked
The parser always translates the solutions to: <textarea/>
Thanks in advance ;)
Cheers
Furia wrote:
> Hi,
> I can't get a blank textarea when applying my .xslt to a .xml file. I
> know this is a common error because I've already found some solutions
> but none worked
> The parser always translates the solutions to: <textarea/>
Have you tried inserting an
<textarea>
<xsl:text> </xsl:text>
</textarea>
///Peter
XML FAQ: http://xml.silmaril.ie/
|||"Peter Flynn" wrote:
> Have you tried inserting an
><textarea>
><xsl:text> </xsl:text>
></textarea>
Hi,
gona try that but i've tried similar things such as:
<textarea>
<xsl:text> </xsl:text>
</textarea>
and
<textarea>
<xsl:text>&nbps;</xsl:text>
None worked.
Feedback soon, thanks Peter ;)
</textarea>
|||Nop...
None works...it still has a blank space...grrr
Cheers
Furia
I can't get a blank textarea when applying my .xslt to a .xml file. I know
this is a common error because I've already found some solutions but none
worked
The parser always translates the solutions to: <textarea/>
Thanks in advance ;)
Cheers
Furia wrote:
> Hi,
> I can't get a blank textarea when applying my .xslt to a .xml file. I
> know this is a common error because I've already found some solutions
> but none worked
> The parser always translates the solutions to: <textarea/>
Have you tried inserting an
<textarea>
<xsl:text> </xsl:text>
</textarea>
///Peter
XML FAQ: http://xml.silmaril.ie/
|||"Peter Flynn" wrote:
> Have you tried inserting an
><textarea>
><xsl:text> </xsl:text>
></textarea>
Hi,
gona try that but i've tried similar things such as:
<textarea>
<xsl:text> </xsl:text>
</textarea>
and
<textarea>
<xsl:text>&nbps;</xsl:text>
None worked.
Feedback soon, thanks Peter ;)
</textarea>
|||Nop...
None works...it still has a blank space...grrr
Cheers
Furia
Subscribe to:
Posts (Atom)