sql speed
Frank Schima
macsforever2000 at axint.net
Sat Feb 26 19:15:03 CST 2005
Hi Jon,
> I have put together a method of joining cursors by storing recIDs of
> individual searches in arrays, and then either ANDing or ORing the
> arrays (in RB). I then do a final search using the recIDs that are in
> the final array. As a result, there can be thousands of numbers. I
> find that the search is actually pretty slow, no doubt due to the sql
> overhead. For the search below, for about 2800 recIDs, it takes a
> about 7 seconds. I wonder if there is something new in V2 that would
> speed this up (I still need a cursor at the end of the operation).
> Thanks.
I suggest looking at VBitSet and VSet in the V4RB Reference PDF. You
can use the Union method to merge your sets and it will be much faster.
However, I don't see an obvious way to convert it into a VCursor as a
last step. That should be possible I think. Maybe you can Feature
Request something. :^)
Maybe a ToCursor Method with a variable number of parameters
representing fields in the Table.
Vset.ToCursor(field1, field2, ... fieldx) As VCursor
fieldx could be a text string with the field name.
> select id,hit,uniqueID,authors,thedate,title,editors,authorsSortMethod
> from thereferences where RecID in
> (30,33,34,38,39,40,43,56,57,61,62,63,64,65,66,70,71,72,73,86,87,92,114,
> 115,142,157,163,167,169,171,172,174,175,176,178,181,216,219,225,226,235
> ,236,239,240,241,263,264,266,270,271,272,276,277,279,297,298,304,306,30
> 7,308,327,328,331,332,333,334,335,336,337,338,341,342,343,344,345,346,3
> 48,349,350,351,358,360,362,376,377,396,398,400,405,406,407,414,419,420,
> 434,436,437,438,441,443,456,457,458,473,475,486,488,493,499,502,509,511
> ,522,524,529,530,538,544,546,547,551,555,556,563,567,569,574,575,581,58
> 2,583,584,585,591,605,616,618,633,634,635,636,637,639,650,671,695,697,6
> 98,699,700,701,702,703,704,705,707,709,710,711,719,720,721,722,735,742,
> 743,744,745,755,756,757,774,775,776,781,784,810,813,814,815,822,833,849
> ,856,864,865,866,867,868,869,876,888,889,890,891,892,893,894,895,912,91
> 4,918,922,923,935,941,960,961,963,964,966,967,968,969,970,996,997,1022,
> 1023,1024,1025,1026,1036,1037,1038,1043,1044,1045,1046,1047,1048,1049,1
> 051,1052,1053,1054,1058,1059,1060,1061,1062,1063,1064,1065,1069,10!
What's that ! character doing in there? It seems to end every paragraph
of numbers.
Best regards,
Frank Schima
More information about the Valentina-beta
mailing list