Hello Everbody ! I our application we have a search form where the user can fill up to 6 fields. Then we create a dynamic select command depending on the filled fields an pass it to a maxdb datbase.
Select .... From tablex Join .... Join Join Join Where tablex.field1 like '%var1% and tablex.field2 like '%var2%' and tablex.field3 like '%var3%' The "select part" is allways the same. The "where part" of the command is dynamicly build from the fields the users filled in our search form. Field1 is allways filled, field2 to field6 can be filled in any combination but don't have to be Where field1 like '%var1%' Where field1 like '%var1% and field3 like '%var3%' Where field1 like '%var1% and field4 like '%var4%' and field6 like '%var6%' ... Tablex has 5 million records The tables that are joined have between 100000 and 2 million records Selects are slow ! We have to work with like ! (we search for names, post codes ...) What kind of index would speed up the search. One index on each of the 6 search fields ? Combination index (field1 + field2 + field3 ...) Combination indexes with field1? (field1 + field2) (field1+field3) (field1+ field4) Any help welcomed. Best regards Albert ''''' ''''''''' (0 0) +---------oOO-----------(_)------------------------------+ | Tel: 0541/5841-868 | | Fax: 0541/5841-869 | | Mail: mailto:[EMAIL PROTECTED] | | Internet: http://www.piepenbrock.de | +--------------------------------------oOO----------------+ |__|__| || || ooO Ooo -- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]