Anybody got any speed suggestions?
Posted in 1998
Topics: Security, Permissions & Auditing
Hi all, I currently have a situation whereby a program is taking far to long to run, after investigation it is because of the following statement: select max(sequence_number) from opaudm where audits_key matches "sop_order_header*" There is an index on audits_key and sequence_number but the table itself has 400,000 records and there are around 50,000 which have sop_order_header in the audits_key. Has anybody got any suggestion of getting the last sequence number rather than using the select max. For your info the set explain command shows: QUERY: ------ select max(sequence_number) from opaudm where audits_key matches sop_order_header*" Estimated cost 145 Estimated # of Rows Returned: 1 1) roger.opaudm: INDEX PATH (1) Index Keys: audits_key sequence_number Lower Index Filter: roger.opaudm.audits_key MATCHES 'sop_order_header*' Please note that for various reasons I can't store the last sequence number elsewhere because there are other programs outside of my control which write to this table. Please email, thanks Paul -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading