Re: A never-ending query (almost)
Posted in 1995
Derrek Poulson (dirk@xmission.xmission.com) wrote: : I've got a curious problem I'd be interested in hearing any thoughts on. : The machine is an HP9000/755 with HP-UX 9.01 and OnLine 5.01.UD1. The problem : is with a table that has several indexes, including 1 on field1 and 1 on : (field1, field2, field3, field4) (obviously I'm making up the column names). : The table has approx. 1.5 million rows and is 1 table out of 550 or so in its : particular database. A query of the form: : select * from table where field1="xxx" : comes back within a second or so. A query like: : select * from table where field1="xxx" and field2="yyy" : takes between <1 second to over an hour (!), depending on the value of field1. Take a look at the distributions of field1. Does it take as long to get "xxx" using the singleton index as it does using the composite index? I also remember a bug in early 5.XX systems that caused problems with indexes that have more than 64k unique values, but I thought it went away with 5.01. Luck Joe -- --------------------------------------------------------------------------- Joe Lumbley(jlumbley@netcom.com) Dallas, Texas ----------------------------------------------------------------------------