Click here to Skip to main content
15,891,597 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL case function to check for charindex as '' or ',' Pin
Ben Fair10-Dec-08 9:40
Ben Fair10-Dec-08 9:40 
GeneralRe: SQL case function to check for charindex as '' or ',' Pin
Wendelius10-Dec-08 9:52
mentorWendelius10-Dec-08 9:52 
GeneralRe: SQL case function to check for charindex as '' or ',' Pin
Ben Fair10-Dec-08 10:06
Ben Fair10-Dec-08 10:06 
GeneralRe: SQL case function to check for charindex as '' or ',' [modified] Pin
Trustapple10-Dec-08 19:02
Trustapple10-Dec-08 19:02 
GeneralRe: SQL case function to check for charindex as '' or ',' Pin
Wendelius11-Dec-08 4:07
mentorWendelius11-Dec-08 4:07 
GeneralRe: SQL case function to check for charindex as '' or ',' Pin
Trustapple11-Dec-08 18:03
Trustapple11-Dec-08 18:03 
GeneralRe: SQL case function to check for charindex as '' or ',' Pin
Wendelius12-Dec-08 4:19
mentorWendelius12-Dec-08 4:19 
QuestionRight Outer Joins and performance Pin
dl4gbe10-Dec-08 6:38
dl4gbe10-Dec-08 6:38 
Hallo,

I am working in an company which is using extensivly right outer joins. I argue that outer joins are bad for performance, and we have a lot of performance problems. We are using db2 from IBM.

To show you an example (a query which returns page size error in system temporary tablespace)
But nobody seems to care. My colleges add more and more right outer joins to querries.

Here is the example:

Please give me some feetback if this is an ordinary query (my colleges say a database must be able to handle this) or if I am right. I think this query is overkill.

SELECT RentObj.Classific1 AS Classific1, RentObj.Classific2 AS Classific2, RentObj.Classific3 AS Classific3, RentObj.Classific4 AS Classific4, RentObj.Classific5 AS Classific5, RentObj.Classific6 AS Classific6, RentObj.Classific7 AS Classific7, RentObj.Classific8 AS Classific8, RentObj.Classific9 AS Classific9, RentObj.Classific10 AS Classific10, RentObj.RentObjId AS RentObjId, Car.RegistrationNumber AS RegistrationNumber, RentObj.Number AS Number, Classification_1.Code AS CCode_1, Classification_2.Code AS CCode_2, Classification_3.Code AS CCode_3, Classification_4.Code AS CCode_4, Classification_5.Code AS CCode_5, Classification_6.Code AS CCode_6, Classification_7.Code AS CCode_7, Classification_8.Code AS CCode_8, Classification_9.Code AS CCode_9, Classification_10.Code AS CCode_10, Car.RentObjId AS Car_RentObjId, Car.FirstLicense AS FirstLicense, Car.ChassisNo AS ChassisNo, Car.CarDocumentNo AS CarDocumentNo, Car.CarKeyNo AS CarKeyNo, Car.CubicCapacity AS CubicCapacity, Car.Kilowatt AS Kilowatt, Car.PayLoad AS PayLoad, Car.RadioCode AS RadioCode, Car.MayorRevison AS MayorRevison, Car.TankContent AS TankContent, Car.Consumption AS Consumption, Car.Kilometer AS Kilometer, Car.UnitNumber AS UnitNumber, Car.KilometerMax AS KilometerMax, Car.KMHigCos AS KMHigCos, Car.KMCI AS KMCI, Car.FuelType AS FuelType, Car.PS AS PS, Car.BrakeSpecInvest AS BrakeSpecInvest, Car.Totalweight AS Totalweight, Car.Unloadedweight AS Unloadedweight, Car.MatchRegNumber AS MatchRegNumber, Car.ConsumptionCityIn AS ConsumptionCityIn, Car.ConsumptionCityOut AS ConsumptionCityOut, Car.CO2Emission AS CO2Emission, RentObj.CompanyId AS CompanyId, RentObj.RentObjTypeId AS RentObjTypeId, RentObj.LicenceeId AS LicenceeId, RentObj.ObjEvent AS ObjEvent, RentObj.StationCIId AS StationCIId, RentObj.ObjPositionCIId AS ObjPositionCIId, RentObj.CostCarrierId AS CostCarrierId, RentObj.CheckInStatPlanId AS CheckInStatPlanId, RentObj.CheckInDatePlan AS CheckInDatePlan, RentObj.State AS State, RentObj.Notice AS Notice, RentObj.SumActCostYear AS SumActCostYear, RentObj.SumEstCostYear AS SumEstCostYear, RentObj.SumActCostMonth AS SumActCostMonth, RentObj.SumActCostDay AS SumActCostDay, RentObj.SumActCostHour AS SumActCostHour, RentObj.SumEstCostsMonth AS SumEstCostsMonth, RentObj.SumActCostWeek AS SumActCostWeek, RentObj.SumEstCostWeek AS SumEstCostWeek, RentObj.CostActDay AS CostActDay, RentObj.CostEstDay AS CostEstDay, RentObj.OperatingLife AS OperatingLife, RentObj.Startavailability AS Startavailability, RentObj.ClassificDescr AS ClassificDescr, RentObj.DateEstSale AS DateEstSale, RentObj.DateActSale AS DateActSale, RentObj.SalesType AS SalesType, RentObj.WebVisible AS WebVisible, RentObj.LedgerId AS LedgerId, RentObj.LedgerAsset AS LedgerAsset, RentObj.TaxId AS TaxId, RentObj.isAlienRentObj AS isAlienRentObj, RentObj.CountService AS CountService, RentObj.CreateDataSrc AS CreateDataSrc, RentObj.RentContractNote AS RentContractNote, RentObj.LedgerProcCode AS LedgerProcCode, RentObj.MinDriverLicence AS MinDriverLicence, RentObj.MinDriverAge AS MinDriverAge, RentObj.PriceSellWWW AS PriceSellWWW, RentObj.ListPriceNet AS ListPriceNet, RentObj.ListPriceGross AS ListPriceGross, RentObj.ListPriceType AS ListPriceType, RentObj.PurchasePrice AS PurchasePrice, RentObj.ResidalPrice AS ResidalPrice, RentObj.PurchaseDiscount AS PurchaseDiscount, RentObj.AmortizationType AS AmortizationType, RentObj.AmortizationRecord AS AmortizationRecord, RentObj.BankPercent AS BankPercent, RentObj.LastBankAmount AS LastBankAmount, RentObj.AmortizationAct AS AmortizationAct, RentObj.CustKeyBuyer AS CustKeyBuyer, RentObj.LeasingStart AS LeasingStart, RentObj.LeasingEnd AS LeasingEnd, RentObj.CustKeyLeaser AS CustKeyLeaser, RentObj.LeasingDuration AS LeasingDuration, RentObj.RentDurationType AS RentDurationType, RentObj.CustKeySup AS CustKeySup, RentObj.LeasBackBuy AS LeasBackBuy, RentObj.LeasBackBuyDate AS LeasBackBuyDate, RentObj.LeasRate AS LeasRate, RentObj.SupOrderNo AS SupOrderNo, RentObj.UsageState AS UsageState, RentObj.DamageCount AS DamageCount, RentObj.DamageCosts AS DamageCosts, RentObj.TransferCosts AS TransferCosts, RentObj.CountWKZPrint AS CountWKZPrint, RentObj.WKZType AS WKZType, RentObj.WKZDemarc AS WKZDemarc, RentObj.WKZBase AS WKZBase, RentObj.WKZAmount AS WKZAmount, RentObj.WKZDueDate AS WKZDueDate, RentObj.WKZDuration AS WKZDuration, RentObj.WKZPersonAccNo AS WKZPersonAccNo, RentObj.WKZPercent AS WKZPercent, RentObj.WKZTaxId AS WKZTaxId, RentObj.ActivOrgaKey AS ActivOrgaKey, RentObj.RentContractId AS RentContractId, RentObj.RentObjTransactId AS RentObjTransactId, RentObj.WWWSellDescr AS WWWSellDescr, RentObj.PurchasePrCalcPer AS PurchasePrCalcPer, RentObj.PurchasePrCalcMonth AS PurchasePrCalcMonth, RentObj.PurchasePrCalcBase AS PurchasePrCalcBase, RentObj.CalcCode1 AS CalcCode1, RentObj.CalcCode2 AS CalcCode2, RentObj.CalcCode3 AS CalcCode3, RentObj.CalcCode4 AS CalcCode4, RentObj.CalcCode5 AS CalcCode5, RentObj.CalcCode6 AS CalcCode6, RentObj.CalcCode7 AS CalcCode7, RentObj.CalcCode8 AS CalcCode8, RentObj.CalcCode9 AS CalcCode9, RentObj.CalcCode10 AS CalcCode10, RentObj.Classific11 AS Classific11, RentObj.Classific12 AS Classific12, RentObj.Classific13 AS Classific13, RentObj.Classific14 AS Classific14, RentObj.Classific15 AS Classific15, RentObj.ClassificDescr2 AS ClassificDescr2, RentObj.ClassificDescr3 AS ClassificDescr3, RentObj.ClassificDescr4 AS ClassificDescr4, RentObj.ClassificDescr5 AS ClassificDescr5, RentObj.ContentRentObjId AS ContentRentObjId, RentObj.PropertyVariId AS PropertyVariId, RentObj.LedgerIdDeprec AS LedgerIdDeprec, RentObj.LedgerIdAsset AS LedgerIdAsset, RentObj.SupBillNo AS SupBillNo, RentObj.BillingDate AS BillingDate, RentObj.InsurClassific1 AS InsurClassific1, RentObj.InsurClassific2 AS InsurClassific2, RentObj.LeasContractNo AS LeasContractNo, RentObj.CheckOutDate AS CheckOutDate, RentObj.CheckInDate AS CheckInDate, RentObj.CheckOutStationId AS CheckOutStationId, RentObj.Lic_ShortDescr AS Lic_ShortDescr, RentObj.CustKeyPES AS CustKeyPES, RentObj.PESNotice AS PESNotice, RentObj.PESAmountDisc AS PESAmountDisc, RentObj.PESAmountNet AS PESAmountNet, RentObj.hasSellBill AS hasSellBill, RentObj.TaxPerc AS TaxPerc, RentObj.PurchaseDicountAmount AS PurchaseDicountAmount, RentObj.AmountSellPlan AS AmountSellPlan, RentObj.AmountSellNet AS AmountSellNet, RentObj.SellDiscPerc AS SellDiscPerc, RentObj.AmountSellDisc AS AmountSellDisc, RentObj.SellTaxId AS SellTaxId, RentObj.SellTaxPerc AS SellTaxPerc, RentObj.AmountSellGross AS AmountSellGross, RentObj.PurchaseTaxAmount AS PurchaseTaxAmount, RentObj.AmountSellTax AS AmountSellTax, RentObj.AgentIdBuyer AS AgentIdBuyer, RentObjType.RentObjTypeNo AS RentObjTypeNo, CostCarrier.Descr1 AS CostCarrier_Descr1, CostCarrier.CostCarrierNo AS CostCarrierNo, CostCarrier.CostCarrierNoC AS CostCarrierNoC, Ledger.LedgerNo AS LedgerNo, Ledger.Descr1 AS Ledger_Descr1, Ledger.TaxPercentage AS TaxPercentage, Ledger.LedgerNoC AS LedgerNoC, RentObj.StateShortDescr AS StateShortDescr, RentObj.AssetNo AS AssetNo, BusinessArea.ShortDescr AS BusinessAreaShortDescr, RentObj.BusinessAreaId AS BusinessAreaId, BusinessAreaAsset.ShortDescr AS BussAreaAssetShortDescr, RentObj.BussAreaAssetId AS BussAreaAssetId, RentObj.ExtCode1 AS ExtCode1, RentObj.ExtCode2 AS ExtCode2, RentObj.ExtCode3 AS ExtCode3, RentObj.ExtCode4 AS ExtCode4, RentObj.ExtCode5 AS ExtCode5, RentObj.ClassificDamageImageId AS ClassificDamageImageId, RentObj.NextAppointmentDate AS NextAppointmentDate, RentObj.NextAppointmentKM AS NextAppointmentKM, RentObj.NextAppointmentDateType AS NextAppointmentDateType, RentObj.NextAppointmentKMType AS NextAppointmentKMType, RentObj.hasBuyBill AS hasBuyBill, RentObj.DoAutoCalculateCosts AS DoAutoCalculateCosts, RentObj.WKZNo AS WKZNo, RentObj.WKZBonusNo AS WKZBonusNo, RentObj.PlanStartAvailability AS PlanStartAvailability, Classification11.Code AS CCode_11, Classification12.Code AS CCode_12, RentObj.PESAmountOpen AS PESAmountOpen, RentObj.PESAmountBooked AS PESAmountBooked, RentObj.LastAccrualDate AS LastAccrualDate, RentObj.ClassificDescr6 AS ClassificDescr6, Classification_1.ShortDescr AS ShortDescr_CL1, Classification_2.ShortDescr AS ShortDescr_CL2, Classification_3.ShortDescr AS ShortDescr_CL3, Classification_4.ShortDescr AS ShortDescr_CL4, Classification_5.ShortDescr AS ShortDescr_CL5, Classification_6.ShortDescr AS ShortDescr_CL6, Classification_7.ShortDescr AS ShortDescr_CL7, Classification_8.ShortDescr AS ShortDescr_CL8, Classification_9.ShortDescr AS ShortDescr_CL9, Classification_10.ShortDescr AS ShortDescr_CL10, Classification11.ShortDescr AS ShortDescr_CL11, Classification12.ShortDescr AS ShortDescr_CL12, RentObj.cid_modda AS cid_modda, RentObj.CountABDataInt1 AS CountABDataInt1, RentObj.CountABDataInt2 AS CountABDataInt2, RentObj.CountABDataInt3 AS CountABDataInt3, 'EMA' AS EMA, RentObj.SellPlanDampingPr AS SellPlanDampingPr, RentObj.OwnRentObj AS OwnRentObj, Classification_1.ClassificationId AS ClassificationId1, Classification_10.ClassificationId AS ClassificationId10, Classification_2.ClassificationId AS ClassificationId2, Classification_3.ClassificationId AS ClassificationId3, Classification_4.ClassificationId AS ClassificationId4, Classification_5.ClassificationId AS ClassificationId5, Classification_6.ClassificationId AS ClassificationId6, Classification_7.ClassificationId AS ClassificationId7, Classification_8.ClassificationId AS ClassificationId8, Classification_9.ClassificationId AS ClassificationId9, Classification11.ClassificationId AS ClassificationId11, Classification12.ClassificationId AS ClassificationId12 FROM CRM.Car Car, CRM.Classification Classification12 RIGHT OUTER JOIN CRM.Classification Classification11 RIGHT OUTER JOIN CRM.BusinessArea BusinessAreaAsset RIGHT OUTER JOIN CRM.BusinessArea BusinessArea RIGHT OUTER JOIN CRM.Ledger Ledger RIGHT OUTER JOIN CRM.CostCarrier CostCarrier RIGHT OUTER JOIN CRM.RentObjType RentObjType RIGHT OUTER JOIN CRM.Classification Classification_2 RIGHT OUTER JOIN CRM.Classification Classification_3 RIGHT OUTER JOIN CRM.Classification Classification_4 RIGHT OUTER JOIN CRM.Classification Classification_5 RIGHT OUTER JOIN CRM.Classification Classification_6 RIGHT OUTER JOIN CRM.Classification Classification_7 RIGHT OUTER JOIN CRM.Classification Classification_8 RIGHT OUTER JOIN CRM.Classification Classification_9 RIGHT OUTER JOIN CRM.Classification Classification_10 RIGHT OUTER JOIN CRM.Classification Classification_1 RIGHT OUTER JOIN CRM.RentObj RentObj ON Classification_1.ClassificationId = RentObj.Classific1 ON Classification_10.ClassificationId = RentObj.Classific10 ON Classification_9.ClassificationId = RentObj.Classific9 ON Classification_8.ClassificationId = RentObj.Classific8 ON Classification_7.ClassificationId = RentObj.Classific7 ON Classification_6.ClassificationId = RentObj.Classific6 ON Classification_5.ClassificationId = RentObj.Classific5 ON Classification_4.ClassificationId = RentObj.Classific4 ON Classification_3.ClassificationId = RentObj.Classific3 ON Classification_2.ClassificationId = RentObj.Classific2 ON RentObjType.RentObjTypeId = RentObj.RentObjTypeId ON CostCarrier.CostCarrierId = RentObj.CostCarrierId ON Ledger.LedgerId = RentObj.LedgerId ON BusinessArea.BusinessAreaId = RentObj.BusinessAreaId ON BusinessAreaAsset.BusinessAreaId = RentObj.BussAreaAssetId ON Classification11.ClassificationId = RentObj.Classific11 ON Classification12.ClassificationId = RentObj.Classific12 WHERE Car.RentObjId = RentObj.RentObjId AND (((RentObj.ObjEvent = '20')) AND ((RentObj.State = '02')) AND RentObj.isAlienRentObj = 0) AND (RentObj.CompanyId = 10) ORDER BY 14 ASC
GeneralRe: Right Outer Joins and performance Pin
Hesham Amin10-Dec-08 8:09
Hesham Amin10-Dec-08 8:09 
AnswerRe: Right Outer Joins and performance Pin
Jörgen Andersson10-Dec-08 8:35
professionalJörgen Andersson10-Dec-08 8:35 
AnswerRe: Right Outer Joins and performance Pin
Wendelius10-Dec-08 8:54
mentorWendelius10-Dec-08 8:54 
GeneralRe: Right Outer Joins and performance [modified] Pin
dl4gbe10-Dec-08 16:36
dl4gbe10-Dec-08 16:36 
GeneralRe: Right Outer Joins and performance Pin
Wendelius11-Dec-08 5:41
mentorWendelius11-Dec-08 5:41 
QuestionUse a calculated value in multiple places in a query Pin
totig10-Dec-08 5:30
totig10-Dec-08 5:30 
AnswerRe: Use a calculated value in multiple places in a query Pin
Wendelius10-Dec-08 6:33
mentorWendelius10-Dec-08 6:33 
GeneralRe: Use a calculated value in multiple places in a query Pin
totig10-Dec-08 6:35
totig10-Dec-08 6:35 
GeneralRe: Use a calculated value in multiple places in a query Pin
Wendelius10-Dec-08 9:34
mentorWendelius10-Dec-08 9:34 
GeneralRe: Use a calculated value in multiple places in a query Pin
Ben Fair10-Dec-08 9:17
Ben Fair10-Dec-08 9:17 
GeneralRe: Use a calculated value in multiple places in a query Pin
Wendelius10-Dec-08 9:26
mentorWendelius10-Dec-08 9:26 
GeneralRe: Use a calculated value in multiple places in a query Pin
Ben Fair10-Dec-08 9:41
Ben Fair10-Dec-08 9:41 
GeneralRe: Use a calculated value in multiple places in a query Pin
PIEBALDconsult10-Dec-08 15:49
mvePIEBALDconsult10-Dec-08 15:49 
GeneralRe: Use a calculated value in multiple places in a query Pin
Wendelius10-Dec-08 18:16
mentorWendelius10-Dec-08 18:16 
QuestionLimits in list length for IN clause Pin
Jörgen Andersson9-Dec-08 22:54
professionalJörgen Andersson9-Dec-08 22:54 
AnswerRe: Limits in list length for IN clause Pin
Wendelius10-Dec-08 4:27
mentorWendelius10-Dec-08 4:27 
GeneralRe: Limits in list length for IN clause Pin
Jörgen Andersson10-Dec-08 5:04
professionalJörgen Andersson10-Dec-08 5:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.