Question for SQL gurus in "netland"
Posted in 1993
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Greetings, I am working on an INFORMIX-SQL project using SCO ODT v2.0. I was wondering if anybody could help me with my problems? In ESQL/C or SQL if I want to find the highest Number used I use the statement. select max(s_page_number) from salesbook; This crunches for about 10 seconds and returns the correct answer. According to the sqlexplain.out file It is doing a sequential search. The column s_page_number is indexed. Is there a way to tell max to use the index. For our purpose the 10 second wait is unacceptable for an entry screen. Another question if I want to find the last sequential Record added i can use: select max(rowid) from salesbook; This again takes to long. Is there a faster way? Any and all help would be greatly appreciated.. TIA, Ed G. ******************************************************************************* Ed Geraghty | "There is no true escape - I am watching Systems Manager | all the time..." - JP "Electric Eye" Albert Einstein College of Medicine | Dynamic Brain Imaging Lab | "Whenever you dream, you're holding a Bronx, NYC 10461 | key. It opens a door to let you be email: geraghty@aecom.yu.edu | free" - Ronnie James Dio *******************************************************************************