Perl 6 - the future is here, just unevenly distributed

IRC log for #askriba, 2017-04-18

| Channels | #askriba index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
04:04 dboehmer_ joined #askriba
04:25 vanstyn_ joined #askriba
06:36 ashimema joined #askriba
10:19 ashimema any advice on natural sorting of resultsets?
10:19 ashimema I'm pondering whether to attempt to do somthing at the database level.. or at the resultset level
10:20 ashimema and whether using Sort::Naturally on a field in the resultset might work
10:20 ashimema not got any code at all yet.. but another 'wonder if someone else has come up with an answer for this before' type question.
10:21 ashimema Sort::Naturally looks nice as it can take locale into account
10:40 ribasushi ashimema: depends on your case
10:41 ribasushi type of rdbms(es); amount of data ( how many rows ); language variability; presence of language mixes <-- what are the answers to these?
10:52 ashimema postgres is the dbms
10:53 ashimema currently languages are british english only, but we are looking to internationalise the product at some point
10:54 ashimema I don't believe our internationalisation will include mixing languages
10:54 ashimema and.. how many rows..
10:55 ashimema hmm.. that one is the hardest one.. varies.. right now it's likely to be low teens, but there's no coded limit in the software so that could grow on the use case
11:06 ribasushi ashimema: if the rdbms will remain static - then it's likely worthwhile to look at pg extensions dedicated to custom sorting
11:06 ribasushi ashimema: if you need to be cross-platform and/or need to support user-side locale: then you can't really get away from retrieving the entire result and sorting it app-side
11:17 ashimema cheers ribasushi, that's helpful
11:17 ashimema I had a feeling that might be the case.. grab whole set and sort app-side
11:18 ashimema I can handle this as a background job at least I think
11:19 ribasushi ashimema: there are other tricks of course - you could *write* data with a pre-determined sortkey
11:19 ashimema that's actually what I'm thinking I might end up doing
11:19 ribasushi i.e. you normalize the stuff you need to sort by inserting extra 0's etc where necessary, and then use that as the sort-column on every read
11:20 ribasushi by now you should be clear why there is no "general solution" for this - the tradeoffs are too versatile
11:20 ashimema this is all inside a nestedset table.. (yes, I know.. I should switch to materialized path at some point)..
11:20 ashimema but it's inherently sorted by lft/rgt columns
11:20 ashimema deffo understand why there's no general solution
11:45 Relequestual joined #askriba

| Channels | #askriba index | Today | | Search | Google Search | Plain-Text | summary