Thanks  Gary, 

With this I am able to reduced the query time from 60 Seconds to 
3 Seconds only !!!!



-----Original Mesage -------

Try something like this:

dim polyobj as object
dim r_id as integer

fetch first from poly_table
do while not eot(poly_table)
   polyobj = poly_table .obj
   r_id = poly_table.rowid

   select * from point_table where obj within polyobj and point_table.desired_col = 
"value" 
   print   r_id +"  "+selectioninfo(sel_info_nrows) 
fetch next from poly_table
loop

If you compile this in mapbasic and run the resulting  .mbx  in mapinfo it will 
display the results in a message box

gary






>>> "Adi" <[EMAIL PROTECTED]> 08/07/99 05:31AM >>>
I am sorry for not getting it properly, 
I will be thanksful if you can give me little more details

Thnaks in advance



---- Original Message ------
Date:          Fri, 06 Aug 1999 12:27:45 -0400
From:          "Gary Searles" <[EMAIL PROTECTED]>
To:            <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
Subject:       Re: MI SQL

Through MB, if you use an object variable to represent the polygon(s) and then do your 
multiple query against the variable instead of the table obj
  the query will run much faster.
gary 

>>> "Adi" <[EMAIL PROTECTED]> 08/06/99 06:04AM >>>
Dear List members. 

I have one polygon table and few point table. And many a 
times I need to run the query to identify the particular point 
falls in which polygon or in a particular polygon how many 
points are there. for this I run this simple query (through MB)

Run_depot = "select dname from "+szboun_name+", "+ 
TAB_TO_SEARCH +"  where "+ TAB_TO_SEARCH+".NAME  
= "+""""+city_find+""""+" AND "+szboun_name+".obj 
contains "+TAB_TO_SEARCH+".obj into depot_found"

Actually Syntex I use is : 

select col from poly_tab, point_tab where point_tab.desiredcol 
= "Value" and poly_tab.obj contains point_tab.obj 

( If I use this in two line syntex as first selecting the name of point 
and then the output point is searched in polygon table it is 
much faster , but the only problem is MI can  perform dynamic 
join only on base tables, so I will have to save the intermediate table
and that is too tedious process and occupies unnecessaty space in Harddisk)


this takes at least 1 min. to give result. 
How can I optimize it for min. time.

Thanks a lot 
===================================================
Aditya 
Executive (Systems) 
Information Systems Department
GCMMF, Anand
E-mail me at Mailto:[EMAIL PROTECTED] 
Web Site: http://www.amul.com 
===================================================
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED] 

----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED] 
===================================================
Aditya 
Executive (Systems) 
Information Systems Department
GCMMF, Anand
E-mail me at Mailto:[EMAIL PROTECTED] 
Web Site: http://www.amul.com 
===================================================

===================================================
Aditya 
Executive (Systems) 
Information Systems Department
GCMMF, Anand
E-mail me at Mailto:[EMAIL PROTECTED]
Web Site: http://www.amul.com
===================================================
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to