Re: why does this wmi query take 10 minutes on a dual proc 2GB memory raid 1 15K scsi server?
- From: "kTell" <tmkeller@xxxxxxxxx>
- Date: 12 Dec 2006 12:20:58 -0800
Well - I solved my issue. I'm not sure if changing the class I'm
querying shortened the time (since CIM_DataFile inherits everything
from CIM_LogicalFile) but I'm sure that adding the drive and path is
what totally sped up the query. Anyway - for anyone having performance
issues when doing a WMI wql query with a wildcard search because
file.exists can't handle or support a wildcard (without loading into an
arry and iterating) - here is what you do:
Select * From CIM_LogicalFile Where Drive = 'c:' AND Path = '\\"&
server & "\\Backups\\' AND Name LIKE '%" & myVar & "%'
where server is obvious, and myVar is the known part of the file I was
searching for. You don't have to use those variables, it was just
easier for me. But be sure to give it a drive and a path if possible.
Otherwise it's going to take a while.
This query above only takes 5 seconds at the most, whereas my first
post took 10 - 15 minutes.
Oh - and it's always best to test it through a wbemtest query before
running the script, because the "close" button works great to terminate
a long running query. I guess you could endtask on wmiprvse.exe, but
why bother?
Oh and one other thing, you must escape under_scores if they're in your
filename, like [_]. But if you're like me, you don't do bushleague
filenaming practices like that.
.
- References:
- Prev by Date: Win32_NetworkConnection.UserName is empty on W2K3
- Next by Date: Re: How to match keys/qualifiers for two instances of two different classes
- Previous by thread: Re: why does this wmi query take 10 minutes on a dual proc 2GB memory raid 1 15K scsi server?
- Next by thread: Re: Creating a 'union' of two classes in WMI
- Index(es):
Loading