Hi Andrew - On Mon, Jan 7, 2019 at 12:00 AM Andrew Gierth <and...@tao11.riddles.org.uk> wrote:
> >>>>> "Alexander" == Alexander Farber <alexander.far...@gmail.com> writes: > Alexander> With the further help of the IRC folks the query has been > Alexander> optimized (7-10 seconds -> 0.3 second) > > 0.3 MILLIseconds, actually. > > (You chanced not to catch me around on IRC, but I see that didn't > matter.) > it is amazing to see how the query I got used to be so slow in the past months is suddenly returning so quickly. Yes, I figured I have missed you on the IRC yesterday, but the advice to go there (haven't used it for 20 years) has been very helpful anyway. > Alexander> CREATE INDEX ON words_moves (gid, played DESC); > Alexander> CREATE INDEX ON words_social (uid, stamp DESC); > > I'm not a big fan of using DESC on indexes; it's almost never needed, > because any btree index can be scanned in reverse. (You only actually > need it if you're mixing ASC/DESC orderings in an ORDER BY and want an > index that matches it.) > Ok good to know, I will remove the DESC from the indices. Regards Alex