<div dir="ltr">I could be wrong, but I think you might be able to speed it up by indexing on just the leftmost column (col1, in your example), if you haven't indexed on that already.<div><br></div><div>David</div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On 21 February 2014 11:30, Tom Stuart <span dir="ltr"><<a href="mailto:tom@codon.com" target="_blank">tom@codon.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">On 21 Feb 2014, at 11:22, Andrew Stewart wrote:<br>
> Does anyone have any tips?<br>
<br>
</div>Have you considered precomputing some kind of hash (of the attributes whose values you care about) when you create/update the record, and then indexing & querying on that? Even if there are collisions, it's probably easy to filter them out in Ruby after the query.<br>

<br>
Cheers,<br>
-Tom<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</div></div></blockquote></div><br></div>