Re: How to read query plan
От | Kaloyan Iliev Iliev |
---|---|
Тема | Re: How to read query plan |
Дата | |
Msg-id | 4235C3E9.2080505@faith.digsys.bg обсуждение исходный текст |
Ответ на | Re: How to read query plan (Miroslav Šulc <miroslav.sulc@startnet.cz>) |
Ответы |
Re: How to read query plan
|
Список | pgsql-performance |
Hi,
I have an idea about your problem. Will it be difficult not to change the entire code but only the queries? You can change type in the Postgres to bool. Then, when select data you can use a CASE..WHEN to return 'Y' or 'N' or even write a little function which accepts bool and returns 'Y' or 'N'. In this case in all your queries you will have to replace the select of bool field with select form the function.
Kaloyan
Miroslav Љulc wrote:
I have an idea about your problem. Will it be difficult not to change the entire code but only the queries? You can change type in the Postgres to bool. Then, when select data you can use a CASE..WHEN to return 'Y' or 'N' or even write a little function which accepts bool and returns 'Y' or 'N'. In this case in all your queries you will have to replace the select of bool field with select form the function.
Kaloyan
Miroslav Љulc wrote:
Tom Lane wrote:Just FYI, I did a quick search-and-replace on your dump to replaceI'll try to change the data type to bool but the problem I stand in front of is that the code expects that SELECTs return 'Y' or 'N' but what I have found out till now is that PostgreSQL returns 't' or 'f' for bool data. I think about some solution but they use CPU :-(
varchar(1) by "char", which makes the column fixed-width without any
change in the visible data. This made hardly any difference in the
join speed though :-(. So that is looking like a dead end.
John's idea about re-joining to the main table to pick up the bulk ofI'll try that. It seems it could work.
its fields only after joining to the sub-tables might work.
regards, tom laneMiroslav
---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
В списке pgsql-performance по дате отправления: