Questions tagged «postgresql-10»

1
为什么PostgreSQL选择较昂贵的联接顺序?
PostgreSQL使用默认值,加上 default_statistics_target=1000 random_page_cost=1.5 版 PostgreSQL 10.4 on x86_64-pc-linux-musl, compiled by gcc (Alpine 6.4.0) 6.4.0, 64-bit 我已经吸尘并进行了分析。该查询非常简单: SELECT r.price FROM account_payer ap JOIN account_contract ac ON ap.id = ac.account_payer_id JOIN account_schedule "as" ON ac.id = "as".account_contract_id JOIN schedule s ON "as".id = s.account_schedule_id JOIN rate r ON s.id = r.schedule_id WHERE …

1
为什么这个LEFT JOIN的表现比LEFT JOIN LATERAL差很多?
我有以下表格(来自Sakila数据库): 电影:film_id是pkey 演员:actor_id是pkey film_actor:film_id和actor_id是影片/演员的键 我正在选择一部特定的电影。对于这部电影,我还希望所有演员都参与该电影。我对此有两个查询:一个带有a LEFT JOIN和一个带有a LEFT JOIN LATERAL。 select film.film_id, film.title, a.actors from film left join ( select film_actor.film_id, array_agg(first_name) as actors from actor inner join film_actor using(actor_id) group by film_actor.film_id ) as a on a.film_id = film.film_id where film.title = 'ACADEMY DINOSAUR' order by film.title; select film.film_id, …

2
在Postgres中什么是“转换表”?
描述Postgres 10中新功能的页面提到“触发器的转换表”。 触发器的转换表 AFTER STATEMENT通过适当地向查询公开新旧行,此功能使触发器既有用又高效。在使用此功能之前,AFTER STATEMENT触发器无法直接访问这些触发器,并且变通办法是拜占庭式的并且性能较差。现在,可以将许多触发逻辑编写为AFTER STATEMENT,从而避免了对FOR EACH ROW触发器所需的每一行进行昂贵的上下文切换的需要。 什么是过渡表?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.