Click here to Skip to main content
15,921,062 members
Home / Discussions / Database
   

Database

 
GeneralADO Connection Failure...HELP!!!!! Pin
girl_lash26-Jul-04 21:27
girl_lash26-Jul-04 21:27 
GeneralRe: ADO Connection Failure...HELP!!!!! Pin
Bill Dean27-Jul-04 4:45
Bill Dean27-Jul-04 4:45 
GeneralRe: ADO Connection Failure...HELP!!!!! Pin
girl_lash27-Jul-04 14:22
girl_lash27-Jul-04 14:22 
GeneralRe: ADO Connection Failure...HELP!!!!! Pin
Bill Dean28-Jul-04 9:49
Bill Dean28-Jul-04 9:49 
GeneralUsing MDB database with OLEDB/ATL/MFC (from SQL Server) Pin
Gian26-Jul-04 2:15
Gian26-Jul-04 2:15 
GeneralWindows-only authentication not working Pin
sid98dha26-Jul-04 0:40
susssid98dha26-Jul-04 0:40 
GeneralRe: Windows-only authentication not working Pin
Mike Dimmick26-Jul-04 5:29
Mike Dimmick26-Jul-04 5:29 
GeneralCurious about a query Pin
brdavid25-Jul-04 15:12
brdavid25-Jul-04 15:12 
The following query

<br />
			SQL.Format("SELECT DISTINCT s.Description FROM ((((SK_SKILLSINAGES AS sia LEFT JOIN SK_SKILLS AS s ON (sia.SkillCode = s.SkillCode) OR (sia.SkillCode = s.ParentSkillCode AND sia.SubSkillCode = s.SkillCode)) INNER JOIN SK_CATEGORY AS c ON sia.CategoryCode = c.CategoryCode) INNER JOIN SK_CATEGORYGROUPS AS cg ON (sia.GroupCode = cg.GroupCode) AND (cg.GroupCode = c.GroupCode)) INNER JOIN AG_AGESINERAS AS ae ON sia.AgeCode = ae.AgeCode) INNER JOIN AG_ERA AS e ON ae.EraCode = e.EraCode WHERE ( (sia.SubSkillCode Is Null AND s.ParentSkillCode Is Null) OR (sia.SubSkillCode Is Not Null AND s.ParentSkillCode Is Not Null) AND  sia.CategoryCode = c.CategoryCode AND sia.GroupCode = cg.GroupCode AND sia.AgeCode = ae.AgeCode) AND ae.Description LIKE 'Middle Ages' AND e.Description LIKE 'Rolemaster' AND s.SkillCode LIKE 'SWORD';"<br />


runs nice and fast however if at the end of the query I add

<br />
OR s.SkillCode LIKE 'LONGSWORD'<br />


The query runs slow. In fact the first query will run instantaneously. the second query takes a few seconds, around 10 seconds. Does anyone know why simply adding an OR statement inflates the time to query a database? Any way of optimizing that somehow?

Hopefully there is enough info here.

Thanks!

Let me add, the first query will return one field while the second query will return 2 fields. Also if you remove
<br />
AND s.SkillCode LIKE 'SWORD'<br />

at the end of the query, the query takes awhile to run again. Again, it seems return 1 record will mean a fast load, but anything larger than that the query slows down considerably. Frown | :(
GeneralRe: Curious about a query Pin
Grimolfr26-Jul-04 4:26
Grimolfr26-Jul-04 4:26 
GeneralRe: Curious about a query Pin
brdavid26-Jul-04 6:04
brdavid26-Jul-04 6:04 
GeneralRe: Curious about a query Pin
Michael Potter26-Jul-04 10:36
Michael Potter26-Jul-04 10:36 
GeneralRe: Curious about a query Pin
Grimolfr26-Jul-04 11:28
Grimolfr26-Jul-04 11:28 
GeneralHOW: format date field in sql Pin
JabraJabra25-Jul-04 13:16
JabraJabra25-Jul-04 13:16 
GeneralRe: HOW: format date field in sql Pin
darkbyte29-Jul-04 1:37
darkbyte29-Jul-04 1:37 
GeneralData type Pin
Peter Mayhew25-Jul-04 4:42
Peter Mayhew25-Jul-04 4:42 
GeneralRe: Data type Pin
Peter Mayhew27-Jul-04 9:24
Peter Mayhew27-Jul-04 9:24 
GeneralDEADLOCK PROBLEMc (ASAP) Pin
Anonymous24-Jul-04 23:26
Anonymous24-Jul-04 23:26 
GeneralRe: DEADLOCK PROBLEMc (ASAP) Pin
Michael Potter26-Jul-04 11:17
Michael Potter26-Jul-04 11:17 
General@@IDENTITY detection with ADO Pin
darkbyte24-Jul-04 10:49
darkbyte24-Jul-04 10:49 
GeneralRe: @@IDENTITY detection with ADO Pin
mav.northwind24-Jul-04 23:49
mav.northwind24-Jul-04 23:49 
Generalweekly,monthly and yearly report Pin
placement24-Jul-04 0:59
placement24-Jul-04 0:59 
GeneralUrgent! Need Help with SQL Statement Pin
bunnymaniac23-Jul-04 15:40
bunnymaniac23-Jul-04 15:40 
GeneralRe: Urgent! Need Help with SQL Statement Pin
Small Rat23-Jul-04 18:47
Small Rat23-Jul-04 18:47 
GeneralRe: Urgent! Need Help with SQL Statement Pin
bunnymaniac26-Jul-04 17:03
bunnymaniac26-Jul-04 17:03 
GeneralOLEDB question... Pin
CherezZaboro23-Jul-04 5:36
CherezZaboro23-Jul-04 5:36 

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.