Hi,
I see that the current query executes two sub-selects, can't this be improved with a query like the one I propose in #434308: Filter duplicate translations? It uses the neat tecnique of ORDER BY CASE which I find very appropriate for the purpose.
Thanks for the module btw, I hope to see an improved and stable version released soon.
Regards,
Antonio.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | select-translation-improve-query_v1.patch | 2.4 KB | ao2 |
Comments
Comment #1
Alice Heaton commentedLooks nice, I did not know of this syntax.
Does it work with both MySql and PostGre ?
Comment #2
ao2 commentedHi,
I tested it with MySql only, but I read on the web that it should work with PostGre too.
Anyway it would be better to test that :)
In the proposed query the original translation case is not handled but it shouldn't be too difficult to add it.
Regards,
Antonio
Comment #3
Alice Heaton commentedThanks, this is very usefull. My queries are very ugly, so this will be very good :)
There's another couple of patches I need to look at for this module ; I'll try and find time to do this this week and I'll make a beta release.
Comment #4
ao2 commentedHi Anselm,
if you haven't looked at this yet I could try to do it myself and send a patch.
Regards,
Antonio
Comment #5
Alice Heaton commentedao2 : I haven't had time to do it - a patch would be great thanks !!!
Comment #6
ao2 commentedOk,
if I understood the drupal scheme right and the original version comes always first we could handle the original language case implicitly in the
ELSEpart of theCASE, something like this (in MySQL):Patch attached which implements this idea in Select Translation.
Needs work and testing :)
Regards,
Antonio
Comment #7
ao2 commentedThe patch exposes this bug #369629: db_rewrite_sql breaks on sql having "order by" clause so it is not fully usable for now.
Comment #8
ao2 commentedThe current version of select_translation uses uncorrelated subqueries, but using the CASE syntax could still be prettier if it's comparable in terms of performance.
For now I am postponing this issue, but if someone has a test case with a lot of nodes please get in touch.
Thanks,
Antonio
Comment #9
ao2 commentedComment #10
anybodySwitching to the latest branch.
Comment #11
anybodyNo real activity since 2009. Closing outdated.