static void gpuscan_add_scan_path(PlannerInfo *root, RelOptInfo *baserel, Index rtinde
发布日期:2021-06-29 18:40:53
浏览次数:2
分类:技术文章
本文共 2520 字,大约阅读时间需要 8 分钟。
文章目录
/* * gpuscan_add_scan_path - entrypoint of the set_rel_pathlist_hook */static voidgpuscan_add_scan_path(PlannerInfo *root, RelOptInfo *baserel, Index rtindex, RangeTblEntry *rte){ Path *pathnode; List *dev_quals = NIL; List *host_quals = NIL; IndexOptInfo *indexOpt; List *indexConds; List *indexQuals; cl_long indexNBlocks; ListCell *lc; /* call the secondary hook */ if (set_rel_pathlist_next) set_rel_pathlist_next(root, baserel, rtindex, rte); /* nothing to do, if either PG-Strom or GpuScan is not enabled */ if (!pgstrom_enabled || !enable_gpuscan) return; /* We already proved the relation empty, so nothing more to do */ if (is_dummy_rel(baserel)) return; /* It is the role of built-in Append node */ if (rte->inh) return; /* * GpuScan can run on only base relations or foreign table managed * by arrow_fdw. */ if (rte->relkind == RELKIND_FOREIGN_TABLE) { if (!baseRelIsArrowFdw(baserel)) return; } else if (rte->relkind != RELKIND_RELATION && rte->relkind != RELKIND_MATVIEW) return; /* Check whether the qualifier can run on GPU device */ foreach (lc, baserel->baserestrictinfo) { RestrictInfo *rinfo = lfirst(lc); if (pgstrom_device_expression(root, baserel, rinfo->clause)) dev_quals = lappend(dev_quals, rinfo); else host_quals = lappend(host_quals, rinfo); } if (dev_quals == NIL) return; /* Check availability of GpuScan+BRIN Index */ indexOpt = pgstrom_tryfind_brinindex(root, baserel, &indexConds, &indexQuals, &indexNBlocks); /* add GpuScan path in single process */ pathnode = create_gpuscan_path(root, baserel, dev_quals, host_quals, 0, indexOpt, indexConds, indexQuals, indexNBlocks); add_path(baserel, pathnode); /* If appropriate, consider parallel GpuScan */ if (baserel->consider_parallel && baserel->lateral_relids == NULL) { int parallel_nworkers = compute_parallel_worker(baserel, baserel->pages, -1.0, max_parallel_workers_per_gather); /* * XXX - Do we need a something specific logic for GpuScan to adjust * parallel_workers. */ if (parallel_nworkers <= 0) return; /* add GpuScan path performing on parallel workers */ pathnode = create_gpuscan_path(root, baserel, dev_quals, host_quals, parallel_nworkers, indexOpt, indexConds, indexQuals, indexNBlocks); add_partial_path(baserel, pathnode); }}
转载地址:https://cyj666.blog.csdn.net/article/details/104922683 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
关注你微信了!
[***.104.42.241]2024年04月12日 03时04分42秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
community framework design
2019-04-30
OAuth2.0流程
2019-04-30
RESTful
2019-04-30
什么是Scrum(一)
2019-04-30
什么是Scrum(二)
2019-04-30
什么是Scrum(三)
2019-04-30
什么是Scrum(四)敏捷开发中,做好Sprint规划
2019-04-30
XP的极限编程(eXtreme Programming)
2019-04-30
什么是Scrum(五)
2019-04-30
什么是Scrum(六)如何进行Scrum开发?
2019-04-30
HtmlAgilityPack
2019-04-30
.net mvc简单工作流设计
2019-04-30
IaaS、PaaS、SaaS区别
2019-04-30
电商促销系统设计参考
2019-04-30
网站架构设计(草稿)
2019-04-30
动态创建IIS站点
2019-04-30
使用TFS玩转Docker自动化部署
2019-04-30
.net core集成vue
2019-04-30
高并发的大型网站架构设计
2019-04-30
IIS url重写&代理设置&关闭ETag
2019-04-30