From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Werner Echezuria <wercool(at)gmail(dot)com> |
Cc: | Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: To know what a macro does |
Date: | 2009-04-27 14:24:39 |
Message-ID: | 20104.1240842279@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Werner Echezuria <wercool(at)gmail(dot)com> writes:
> Later in planner.c on grouping_planner function I do something like this:
Well, you've omitted showing us the code where the problem is likely to
be, but I am kinda thinking that you've shot yourself in the foot by
trying to represent your special ordering clause as a simple constant.
The planner is quite smart enough to throw away "order by constant"
as a no-op. By the time you get down to the pathkey logic it's just
going to be ignoring that clause entirely; and if you try to brute-force
it you're more than likely going to break something.
Rather than kluging up any of this code, I wonder whether you couldn't
represent your fuzzy sorting requirement as ORDER BY some_function(...)
and put all the smarts into that function.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2009-04-27 14:39:33 | Re: psql with "Function Type" in \df |
Previous Message | Sam Halliday | 2009-04-27 14:03:08 | Re: RFE: Transparent encryption on all fields |