On 06/12/13 15:08, jeffrey Butera wrote: > Unidata 7.3.3 on RedHat: I have a table with numerous indicies built: >
> Since these are data fields (nothing computed on-the-fly) and indexed, > queries should be fast. The table has approximately 737,000 records. > > This query runs in under 1 second: > > SELECT H08.CR.COURSE.EVALS WITH XCCE.TERM EQ '2013F' > > However this query takes 10+ seconds (or longer) - even with two indexed > fields: > > SELECT H08.CR.COURSE.EVALS WITH XCCE.TERM EQ '2013F' AND XCCE.TYPE EQ > 'FINCRSE' > > I'm at a loss to explain the second, any insight appreciated. > Can't speak for UniData, but on *older* versions of UV, this is what would be expected. UV only used one index, and even if further select fields were indexed it would run a full scan of the records selected by the first index. However, this was fixed in UV quite a long time ago. I'd be surprised if it wasn't fixed in modern UD too, either. If you're just doing a select, then I'd try the following (dunno if it's available in UD, don't know the exact correct syntax for UV) SELECT WITH TERM EQ 2013F TO 1 SELECT WITH TYPE EQ FINCRSE TO 2 SELECT INTERSECT 1 2 TO 0 Does that take 10 seconds? Something's bizarrely wrong if so. The other thing, does SELECT have an explain clause that'll tell you what it's doing? If none of this works, just create an i-descriptor of the two fields concatenated, and select on that. Cheers, Wol _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
