Where False VS PK=0

KitaYama

Well-known member
Local time
Today, 12:05
Joined
Jan 6, 2022
Messages
1,779
I have a form that has to show the result of a search in a specific order.
To maintain the necessary result I have a cross tab query, a result of joining 3 tables, and use it as the record source of my form.
Opening the query by itself, shows a little less than half a million records.

The form's record source reads as :
Code:
SELECT * FROM MyCrossTabQuery WHERE False;
Opening the form is very fast, without any delay. Because the form opens empty,
then I change the source code to something like :
Code:
SELECT * FROM MyCrossTabQuery WHERE ShippedOn IS NULL AND Delivery BETWEEN X AND Y
Everything was just fine until 2 weeks ago.
Since then, opening the form with the exact same record source takes 2 to 3 minutes. (approximately. Have not timed the delay)
Once the form is opened after a long wait, applying filter is very fast, just like before.

I noticed that if I change the record source of the form to the following, everything is back to normal.

Code:
SELECT * FROM MyCrossTabQuery WHERE OrderPK=0;

While I solved the delay problem, I'd like to know :
1- Why WHERE False and PK=0 have different results.
2- What might have happened to cause WHERE FALSE take a long time for the form to open.

Thanks.
 
Last edited:
Yes, OrderPK is indexed. But I wonder if the problem is if the filter field is indexed of not, How it was working for the past at least 5 years.

Thanks
 
oopps, i did it again! if your pc's are not getting any update, how about the IT themselves get one.:)
 
Our PCs have been locked by IT to prevent any update.

Before I retired, our U.S. Navy IT staff also blocked updates, though it was mostly so that we could choose the time at which to perform updates. Windows Update will only wait so long before forcing the issue. We couldn't allow a Windows box to just decide to take itself down in the middle of the day, particularly during operations like Desert Shield and Desert Storm.

However, more to the point: What is your back-end in this case? Access DB or some SQL engine? AND if it is not native-Access BE, was the server for that SQL engine somehow updated? In a blocked off domain, things do not change spontaneously. Computers ARE deterministic. They always have a reason to do what they do. I suspect that you just haven't found it yet. This might include getting a new version of an anti-virus package or getting a new network or security product that interacts with device drivers in some way.
 
However, more to the point: What is your back-end in this case?
SQL server
was the server for that SQL engine somehow updated?
I'm not sure about it. I have to ask IT. Now it's midnight here. I can't call one of them at this time. I'll see if I can come back with an answer in the morning.

Thanks
 
Last edited:

Users who are viewing this thread

Back
Top Bottom