Sorry, my emailer messed things up, try it again
0 OpenVirtual 1 0 keyinfo(1,BINARY)
1 Goto 0 31
2 Integer 0 0
3 OpenRead 0 2
4 SetNumColumns 0 2
5 Integer 0 0
6 OpenRead 2 3 keyinfo(1,BINARY)
7 Integer 1 0
8 NotNull -1 11
9 Pop 1 0
10 Goto 0 28
11 MakeRecord 1 0 n
12 MemStore 0 0
13 MoveGe 2 28
14 MemLoad 0 0
15 IdxGE 2 28 +
16 RowKey 2 0
17 IdxIsNull 1 27
18 IdxRowid 2 0
19 MoveGe 0 0
20 Column 0 0
21 MakeRecord -1 0
22 Distinct 1 25
23 Pop 2 0
24 Goto 0 27
25 IdxInsert 1 0
26 Callback 1 0
27 Next 2 14
28 Close 0 0
29 Close 2 0
30 Halt 0 0
31 Transaction 0 0
32 VerifyCookie 0 3
33 Goto 0 2
34 Noop 0 0
<schema>
<tables>
<table id="temp">
<ddl>CREATE TABLE temp (Name varchar(255),RxDT DateTime)</ddl>
<columns>
<column id="Name" type="varchar(255)"/>
<column id="RxDT" type="DateTime"/>
</columns>
<indexes>
<index id="w" unique="0">
<ddl>CREATE INDEX t on temp(rxdt)</ddl>
<column id="Name"/>
</index>
<index id="t" unique="0">
<ddl>CREATE INDEX t on temp(rxdt)</ddl>
<column id="RxDT"/>
</index>
</indexes>
</table>
</tables>
</schema>
Wilfried Mestdagh wrote:
Hi Bert,
'select distinct Name ' +
'from Rx ' +
'where RxDT >= ' + DT + ' ' +
'order by Name'
One thing is not yet clear to me. That is the 'distinct'. To have this
as fast as possible I have to make also a separate index on "RxDt,
Name". Is that correct ? (or the way around: "Name, RxDt" ?)
---
Rgds, Wilfried
http://www.mestdagh.biz