全局临时表与普通表的性能效率 - Oracle 10g
我正在使用大量全局临时表来针对 Oracle 10g 数据库生成大量报告。每个报告由 4 到 5 个全局临时表 (GTT) 组成。但据我了解 GTT 的概念,数据是在每个会话中为不同的参数集动态创建的。
例如,在我的场景中,20 个用户生成报告,例如上个月的销售数据,每天总共可能会产生多达 1000 次执行。但是,如果我们假设用户更频繁地查询最近的销售数据,那么我们如何使用一些缓存来存储像互联网浏览器那样更频繁查询的一系列销售数据呢?另外,任何其他关于微调 GTT 的建议都会非常有帮助。
I am using large number of global temporary tables for generating huge reports against an Oracle 10g database. Each report consists of 4 to 5 global temporary tables(GTT) per say. But as far as I understand the concept of GTT's, the data is created on the fly per each session for different set of parameters.
For example, in my scenario, 20 users generates the report for, say last month of sales data and it can lead to upto 1000 executions on total per day. But if we assume that the user queries most recent sales data more frequently, than how can we use some cache memory to store for a range of sales data that is queried more frequently like a internet browser does??. Also any other suggestions for fine tuning the GTT's would be very helpful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来你过度使用了 GTT。在 Oracle 查询中通常并不经常需要它们 - 与 SQL Server 相比,(我读过)在 SQL Server 中使用临时表更为常见和合适。在不详细了解您的要求的情况下,很难推荐一种方法,但是 物化视图是一次“缓存”查询结果并多次使用它们的一种方式。
It sounds like you are over-using GTTs. They are not normally needed very often in Oracle queries - in contrast to SQL Server where (I have read) it is more common and appropriate to use temporary tables. Without knowing your requirements in detail it is hard to recommend an approach, but materialized views are one way of "caching" query results once and using them many times.