[LRUG] Speeding up a SQL query

David Salgado david at digitalronin.com
Fri Feb 21 03:31:53 PST 2014


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.

David


On 21 February 2014 11:30, Tom Stuart <tom at codon.com> wrote:

> On 21 Feb 2014, at 11:22, Andrew Stewart wrote:
> > Does anyone have any tips?
>
> 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.
>
> Cheers,
> -Tom
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20140221/c753ffdb/attachment.html>


More information about the Chat mailing list