I have a table with 14,655,100 rows in it. No unique keys. I have an index on the fields "symbol", varchar[12], and "qdate", int4 as format=YYYYMMDD. I have a field called "expmoyr", char[6] as format=Mmm-YY. I have a field called "last", float4.
The SQL command: SELECT last FROM table WHERE symbol='Symbol' AND expmoyr='Mmm-YY' ORDER BY qdate DESC LIMIT 1; This query works fine when there is more than one record meeting the criteria. When there is only 1, the query locks and no result is returned. I have tried vacuuming and reindexing the entire database several times. Please let me know if there is a fix to this. Thanks. Steve Thames Softlife Consulting, Inc. 530-672-6908 www.softlife.com ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster