Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Facebook
Downloads
Home
>
mailing lists
Re: [HACKERS] WIP Patch: Precalculate stable functions,infrastructure v1 - Mailing list pgsql-hackers
From
Dmitry Dolgov
Subject
Re: [HACKERS] WIP Patch: Precalculate stable functions,infrastructure v1
Date
December 31, 2017
14:55:47
Msg-id
CA+q6zcX+0q_32J_VLjQ_jwr-MqNLmJZXAbCE+eKrsnhd8Dng5g@mail.gmail.com
Whole thread
Raw
In response to
Re: [HACKERS] WIP Patch: Precalculate stable functions,infrastructure v1
(Marina Polyakova <m.polyakova@postgrespro.ru>)
Responses
Re: [HACKERS] WIP Patch: Precalculate stable functions,infrastructure v1
List
pgsql-hackers
Tree view
> On 31 December 2017 at 06:55, Marina Polyakova <
m.polyakova@postgrespro.ru
> wrote:
>
> Secondly, here there's a sixth version of the patch for the precalculation of
> stable or immutable functions, stable or immutable operators and other
> nonvolatile expressions.
Thanks for your patch, looks quite interesting!
> To not send big patch I have split it (that's why version starts with the
> first again) and here I send infrastructure patch which includes:
Yeah, but it's still 18k lines :) After the first quick glance I have a few
small questions.
If I call a stable function from a query and subquery, looks like it's cached:
```
=# select stable_with_int(1) from (select stable_with_int(1) from x) q;
NOTICE: 00000: stable with int
LOCATION: exec_stmt_raise, pl_exec.c:3353
stable_with_int
-----------------
1
1
1
1
(4 rows)
```
But the same from CTE works different, is it supposed to be like that?
```
=# with data as (select stable_with_int(1) from x) select stable_with_int(1) from data;
NOTICE: 00000: stable with int
LOCATION: exec_stmt_raise, pl_exec.c:3353
NOTICE: 00000: stable with int
LOCATION: exec_stmt_raise, pl_exec.c:3353
stable_with_int
-----------------
1
1
1
1
(4 rows)
```
Also I see this pattern quite some time, maybe it makes sense to move it to a function?
```
+
/* create and return CachedExpr */
+
CachedExpr *new_node = makeNode(CachedExpr);
+
new_node->subexpr = (CacheableExpr *) current_node;
+
+
context->root->hasCachedExpr = true;
+
+
return (Node *) new_node;
```
pgsql-hackers
by date:
Previous
From:
Vik Fearing
Date:
31 December 2017, 14:34:17
Subject:
Sample values for pg_stat_statements
Next
From:
John Naylor
Date:
31 December 2017, 15:01:55
Subject:
Re: MCV lists for highly skewed distributions
Есть вопросы? Напишите нам!
Соглашаюсь с условиями обработки персональных данных
I confirm that I have read and accepted PostgresPro’s
Privacy Policy
.
I agree to get Postgres Pro discount offers and other marketing communications.
✖
×
×
Everywhere
Documentation
Mailing list
List:
all lists
pgsql-general
pgsql-hackers
buildfarm-members
pgadmin-hackers
pgadmin-support
pgsql-admin
pgsql-advocacy
pgsql-announce
pgsql-benchmarks
pgsql-bugs
pgsql-chat
pgsql-cluster-hackers
pgsql-committers
pgsql-cygwin
pgsql-docs
pgsql-hackers-pitr
pgsql-hackers-win32
pgsql-interfaces
pgsql-jdbc
pgsql-jobs
pgsql-novice
pgsql-odbc
pgsql-patches
pgsql-performance
pgsql-php
pgsql-pkg-debian
pgsql-pkg-yum
pgsql-ports
pgsql-rrreviewers
pgsql-ru-general
pgsql-sql
pgsql-students
pgsql-testers
pgsql-translators
pgsql-www
psycopg
Period
anytime
within last day
within last week
within last month
within last 6 months
within last year
Sort by
date
reverse date
rank
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
By continuing to browse this website, you agree to the use of cookies. Go to
Privacy Policy
.
I accept cookies