Hi,

I would need to do a query like
SELECT * FROM mytable WHERE match (a) against("+AAA" in boolean mode)
and match (b against("+BBB" in boolean mode)
and match (a,b) against("+AAA +BBB" in boolean mode)

If I would omit the last line (which seems to be redundant) I could do
this easily with the Django framework by
s.filter(a__search='AAA', b__search='BBB')

However it turned out that doing the query with the last line is far
more efficient for MySQL. By querying (a,b) it can query a combined
index which returns only very few rows which then are combined with
the other two AND statements. If I omit the combined index, the temp
table (for doing the AND statement) is far bigger. The speed gain is
about factor 100 - sometimes even more (yes: my tables are quiet large
and it is noticeable)

How would I do this in Django?

Thanks for your help.

Tobias.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to