Leonardo F <m_li...@yahoo.it> writes: >> one idea could be to actually prepare a query using SPI for "select * from >> table order by <cols>" and then peek inside >> to see which plan was generated.
> I like that!!! > Here's a first attempt, it looks like it's working... > (I still have to skip non-btree indexes and expression indexes, plus > add a ASC/DESC to the select) By the time you make this actually work in all cases, it's probably going to be more of a mess than the other way; not to mention that it doesn't work *at all* without violating SPI internals. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers