Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
btree.extract with multiple criteria using the AND operator
We are having an issue where btree.extract returns different results on different workstations when fed the same criteria with the AND (~) operator. The first criteria is field CUSTOMER_NUMBER equal to a customer number. The second criteria is field DATE with a range that starts one year ago and continues to two years in the future. Both dates are calculated on the fly and are relative to the current system date.
On one workstation I get zero hits. On another I get three hits. The OS does not seem to matter. Danh and I (the developers) are running the same OS, Win7 x64, and we get different results. I get three hits and he gets zero even though we are accessing the same data volume.
Has anyone seen this issue before?
On one workstation I get zero hits. On another I get three hits. The OS does not seem to matter. Danh and I (the developers) are running the same OS, Win7 x64, and we get different results. I get three hits and he gets zero even though we are accessing the same data volume.
Has anyone seen this issue before?
Comments
I have a few questions and comments:
I'm a little confused. The "~" operator performs a "BETWEEN" search The "#" operator performs a "NOT" search. Was that just a typo? It might help if you posted a sample syntax for a typical search.
I'm also interested in knowing if the date values you are passing in are formatted as internal or external values.
Finally, what is the value in your SYSENV\CFG_IDX_SETS record? Do you have more than one CFG_IDX_SETS records (i.e., perhaps one is configured for a specific user)?
SEARCH.STRING = SEARCH.FIELD.NAME: @VM: ENTITY.ID : @FM
SEARCH.STRING := "DATE": @VM: BETWEEN.START.DATE
SEARCH.STRING := "~": BETWEEN.END.DATE :@FM
SEARCH.FILE.NAME = "QUOTES"
SEARCH.DICT = DICT.QUOTES
CALL BTREE.EXTRACT (SEARCH.STRING,SEARCH.FILE.NAME,SEARCH.DICT,KEYS)
In this case, SEARCH.FIELD.NAME contains "CUSTOMER_NUMBER" and ENTITY.ID contains "6667". Also, the dates are passed in ICONV format, as integers. I put a debug option in the program to display all of the values.
See attached screen shot.
I will look for the SYSENV\CFG_IDX_SETS record.
We are also having issues with frozen locks on *INDEX records and on specific field name index records. The locks are placed by end user workstations, not by our indexing server. I was going to start a separate thread for that issue but maybe the two are related?
At this point I don't think the locks on *INDEX records are related.
I have always thought that index searches should be done with Oconv formatted data, not Iconv formatted data. Can you see if this makes a difference?
Also, the last time Danh and I worked on index problems, we found significant problems with the way the dictionary columns were maintained. Have you confirmed that your indexed columns all Key ID columns are properly configured?
What do I need to look for in the Key ID columns? Do they need to have a specific data type? Our keys tend to be variable length.
Is D2/ the formatting specified in the dictionary definition?
<1> IDX_SETS2
<2>
<3>
<4> If use of original IDX_SETS is desired, set field 2 to IDX_SETS1;
<5> otherwise, leave blank to use most recent version
I can't find IDX_SETS2 in SYSENV. Is this a table name?
Here are some basic rules to follow:
No, it is just a configuration setting. It means you are using the newer (and fixed) Indexing logic.
I believe, the 'data type'ing is only relevant for external database connections.
Sorry for being MIA. I had an appointment that I required me to be out of the office for a few hours. Thankfully, Barry stepped in and gave you some stellar advice.
This goes to show you that you can take nothing for granted. The client setup possibility is something I bring up when I detect clues that it might be relevant (e.g., "new machine"). Plus, I was already familiar with past indexing issues with your database tables, so my thoughts went there as a first course of action.
Nevertheless, I still encourage you to inspect your field definitions and make sure they are correct. Barry answered you correctly about setting the length. The datatype is irrelevant, although this does set a default length (which you can certainly change).