Board index » delphi » Question about query speed!

Question about query speed!

Hi all!

I have a small question regarding the speed of a query.
I use Paradox, BDE, TQuery.

1st query:
UPDATE Table1
SET Field1 = V1, Field2 = V2
WHERE (Field3 = V3)

2nd query:
UPDATE Table1
SET Field1 = V1, Field2 = V2
WHERE (Field3 = V3)AND((Field1 <> V1)OR(Field2 <> V2))

Is there any difference between the 1st and 2nd query?
I tend to think that the second performs faster, but...

TIA
Mario

 

Re:Question about query speed!


I think the question below is kinda stupid...
Of course the 2nd query is faster, but, does the engine
know to update only Field1 in case the Field2 = V2?

So, is the query speed different when only one field is different
than the given values?
[Field1 <> V1 and Field2 = V2] FASTER THAN [Field1 <> V1 and Field2 <> V2]
???!!!

TIA
Mario

Quote
"Mario" <aon.912995...@aon.at> wrote in message

news:3ef05c2c@newsgroups.borland.com...
Quote
> Hi all!

> I have a small question regarding the speed of a query.
> I use Paradox, BDE, TQuery.

> 1st query:
> UPDATE Table1
> SET Field1 = V1, Field2 = V2
> WHERE (Field3 = V3)

> 2nd query:
> UPDATE Table1
> SET Field1 = V1, Field2 = V2
> WHERE (Field3 = V3)AND((Field1 <> V1)OR(Field2 <> V2))

> Is there any difference between the 1st and 2nd query?
> I tend to think that the second performs faster, but...

> TIA
> Mario

Other Threads