masquerade icon indicating copy to clipboard operation
masquerade copied to clipboard

tableRanges accepts only integer PK

Open fliespl opened this issue 3 years ago • 2 comments

Won't work with UUID or string PK like slack identifier (i.e. U0103P9J5ME)

fliespl avatar Jan 02 '22 19:01 fliespl

Just an idea that might be worth checking:

select min(sub.id), max(sub.id) from (
    SELECT id, ROW_NUMBER() OVER (ORDER BY id ASC) as rownumber from slack_user
) sub
group by ceil(sub.rownumber/5)*5;

This also improved selecting ranges when you are using HA setup where ids might not be sequential, cause it will create equal groups.

In your current code, it would select all records at once: https://ss.codeone.pl/ss-2022-01-02-21-00-06-1641153606-jUDXfXMY.png

Once with above: https://ss.codeone.pl/ss-2022-01-02-21-00-24-1641153624-PrIxomJi.png

fliespl avatar Jan 02 '22 20:01 fliespl

Cool, I'll welcome a PR!

peterjaap avatar Mar 31 '22 04:03 peterjaap