One way to speed up the query might be to avoid the LIKE operator if possible. Especially if you are using it like this "%" + szValue + "%". In this case I guess indexing the column will not help, because MapInfo has to look thru all rows.
Just to make sure I have done some testing on a table with 590000 records. Select * From MYTABLE Where MYCOLUMN = "A given value" Into MY_SEL NoSelect Takes 1 sec. (No index: 10 secs) Select * From MYTABLE Where MYCOLUMN = "A given value%" Into MY_SEL NoSelect Takes 12 sec. (No index: 12 secs) Select * From MYTABLE Where MYCOLUMN = "%A given value%" Into MY_SEL NoSelect Takes 12 sec. (No index: 12 secs) As you can se the time MapInfo uses to perform an exact match with no index is more or less the same as when performing a LIKE search. And appearently there is no difference whether the is a "joker" at both ends or only at the end. Another way to speed up the queries might be to use the NoSelect keyword. This prevents MapInfo from highlighting the selected rows. Peter Horsb�ll M�ller GIS Developer Geographical Information & IT COWI A/S Rug�rdsvej 55 DK-5000 Odense Denmark Tel +45 6313 5013 Direct +45 6313 5008 Mob +45 5156 1045 Fax +45 6313 5090 E-mail [EMAIL PROTECTED] http://www.cowi.dk > -----Original Message----- > From: Eagle, David A [mailto:[EMAIL PROTECTED] > Sent: Monday, June 02, 2003 4:56 PM > To: MapInfo-L ([EMAIL PROTECTED]) > Subject: MI-L Query Efficiency > > > Listers, > > I have created a gazetteer query tool (in MapBasic) to query > an MI table containing 260,000 records. > > The process takes a variable from my dialog and searches the > place name field (indexed) for instances LIKE it and then > returns a query table containing two columns and the object. > The process then goes on to populate an array etc, > etc...However, the query process described takes 20 seconds, > this is always the case and does not vary if I move the > database from its network location to a local drive. > > Any thoughts on how I can speed this process up would be > greatly appreciated... > > ---------------------------------------------- > David A. Eagle > GIS Consultant > > Atkins Design Environment > & Engineering > Cornerstone House > Stafford Park 13, Telford > Shropshire, TF3 3AZ > England > Tel: +44 (0)1952 21 3268 * > Fax: +44 (0)1952 20 0981 * > > Email: [EMAIL PROTECTED] * > Web: www.atkinsglobal.com <www.atkinsglobal.com> * > > > > This email and any attached files are confidential and > copyright protected. If you are not the addressee, any > dissemination of this communication is strictly prohibited. > Unless otherwise expressly agreed in writing, nothing stated > in this communication shall be legally binding. > > > > --------------------------------------------------------------------- > List hosting provided by Directions Magazine | > www.directionsmag.com | To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > Message number: 7107 > --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 7117
