There's another possibility that might be usable, which is to transform the query set. I don't think Jorge has said what the datatype of the filter set is, but perhaps it is numeric or alphabetic.
If numeric, it may be possible to replace some of the 40,000 individual value tests by range tests. Even if that doesn't produce the precise resultset wanted, it can be supplemented by additional queries to retrieve more rows or by additional filtering to remove false hits. Similarly if the data type is alphabetic, it may be possible to combine multiple filters using by pattern-matching queries. Those techniques should reduce the length of the query sent to the server. Of course the original suggestion of IN OR IN OR IN is much simpler to implement, as is mirroring the source if that can be done without performance, consistency or terms-of-business problems. Cheers, Dave _______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/[email protected]
