Tell me more ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have to be very careful here. Both queries are so similar that the only different is the area searched.

What's surprising is the query that run on BIGGER AREA, and naturally yield MORE ROWS, is the one that run way FASTER.

In fact the only reason why I want to run the second query is to narrow down the search because the original query returns too many results.

SELECT BusinessID
FROM tableauxiliary
WHERE MBRWithin( Latlong, GeomFromText( 'MULTIPOINT(-6.2209869856406 106.73701301436,-6.1490130143594 106.80898698564)' ) )
AND MATCH (
FullTextSearch
)
AGAINST (
'res*'
IN BOOLEAN
MODE
)

returns

Showing rows 0 - 29 ( 5,007 total, Query took 0.0226 sec)

Now my code will streamline things up.

I asked the same query except for SMALLER regions

SELECT BusinessID
FROM
  tableauxiliary
WHERE
  MBRContains(
        GeomFromText (
            'MULTIPOINT(-6.1928749092968 106.7651250907,-6.1771250907032 106.7808749093)'
            ),
            Latlong)    
  AND MATCH (FullTextSearch) AGAINST ('res*' IN BOOLEAN MODE)
AND Prominent >15 

Showing rows 0 - 29 ( 30 total, Query took 15.3889 sec)

What gives?

share|improve this question
The queries aren't exactly the same. Does it act the same if you take out the Prominent > 15 in the second one? – Wes Freeman Jun 29 '12 at 17:37

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.