Re: Concatenated Indexes - How do they work?
Date: 19 Feb 1994 00:10:43 GMT
Message-ID: <2k3le3$c48_at_anaxagoras.ils.nwu.edu>
In article <17FEB199418165387_at_xrd.chee.uh.edu> Fred Schulz,
chee77_at_xrd.chee.uh.edu writes:
>The problem in part in that there are only 36 cominations of month and
year,
>so any query returns a lot of rows, which are then summed, averaged, and
>grouped by other foreign keys in the table.
Sounds to me like indices aren't your problem, and that there is little that you can do, if you really must access all of those rows. You could add more columns to your index that would automatically order based on those columns, so that GROUP BY or ORDER BY need not be computed on the fly (could just be read in the right order from the index).
On the other hand, if indexing is an issue, then you could probably get some speedup by converting into char -- not because comparisons will be any faster, but because the index would probably be much smaller (therefore less I/O). Might be even smaller if you concatenated the two fields, but the difference might not be worth the hassle. Note: I'm not sure that NUMBER(2) couldn't do the same thing, but I tend to doubt that it does. Received on Sat Feb 19 1994 - 01:10:43 CET