> That second query may not be the best, as it will probably seqscan and > grab all the pins before only returning the first one ... A partial index where USED_BY is null would eliminate the need for the seqscan on the table... -- Scott Ribe scott_ribe@xxxxxxxxxxxxxxx http://www.killerbytes.com/ (303) 722-0567 voice