适当的使用临时表和表变量。
最后,使用临时表来修改现有数据表的结果。
Finally, you used a temporary table to modify the structure of an existing database table.
要使用临时表,是不是要有用户临时表空间?
Then what the different between system temporary tablespace and user temporary tablespace?
如果不需要修改表的结构,则需要使用临时表,如清单6所示。
If you do need to modify the structure of a table, you need to use a temporary table, as shown in Listing 6.
IWA还无法处理所有类型的查询,比如关联子查询或使用临时表的查询。
IWA does not handle all types of queries yet, such as correlated sub-queries or queries using temp tables.
下面很快就能看到,您甚至可以通过DB 2命令行处理器(CLP)使用临时表。
You can even use temporary tables from the DB2 Command Line Processor (CLP), as you will soon see.
我可以将这些数据“预加载”到实际表中,然后查询而不是使用临时表。
I'd be able to "pre-load" this data into an actual table, and then query off that instead of using temp tables.
我们记得为了要使用临时表,数据库中必须存在一个用户临时表空间(默认情况下没有)。
Recall that in order to use temporary tables, a user temporary table space must exist in the database (none exists by default). Here's how you would create such a table space.
既然我们已经利用有趣的方法创建了使用临时表的过程,接下来就演示临时表及其数据如何可以?
Now that we have established this interesting ability to create procedures which utilize temporary tables, we now demonstrate how temporary tables and their data can be.
然后,我们使用友好的DBA提供的默认用户临时表空间打开跟踪。
We then turn tracing on using the default user temporary table space provided by the friendly DBA.
为了使用该例程,DB 2V8.2.2中需要一个8KB页面的用户临时表空间。
To use this routine in DB2 V8.2.2 requires an 8 KB page user temporary table space.
使用过程来初始化临时表可带来三个主要优点。
Using a procedure to initialize the temporary table yields three key benefits.
当声明临时表的位置与使用它的位置不同时,会引起问题。
Problems arise when the location where a temporary table is declared differs from where it may be used. Consider the following.
临时表的使用限制了对属于MODIFIESSQLdata类别的过程的跟踪。
The usage of a temporary table limits tracing to procedures of the class MODIFIES SQL DATA.
这些改进对于使用大型业务智能化(BI)应用程序和数据仓库的组织尤其有意义,因为它们依赖于索引和临时表。
These enhancements will be of particular interest to organizations with large business intelligence (BI) applications and data warehouses, which depend on indexes and temporary tables.
例如,客户机应用程序可以使用SQL和结果集逻辑把VSAM或IMS数据读取到全局或声明的临时表中,然后处理它们。
For instance VSAM or IMS data can be retrieved into a global or declared temporary table and subsequently processed by client applications using SQL and result set logic.
该优化器将可以识别出这个索引,在维度表上使用过滤器来在一个临时表中生成一个维度表键的有效组合列表。
The optimizer will recognize this index and use the filters on the dimension tables to generate a list of valid combinations of the dimension tables' keys into a temp table.
我的一个测试中使用了一个查询,该查询将一些记录挑选出来放入一个临时表中,然后另一个查询将进一步筛选临时表中的结果。
One of my tests used a query to select records into a temp table and then a second query to further refine the results from the temp tables.
考虑使用表变量来代替临时表。
其他用于用户数据、临时数据和索引数据的表空间则需要在创建数据库之后另行创建,并且在使用这些表空间之前,还需要为之指定一个用户。
Other table spaces for user, temporary and index data need to be created after the database has been created, and a user needs to be assigned to these table spaces before they can be used.
下列 REORG示例重新组织客户表,并使用系统临时表空间 TEMPSAPCE1作为工作区域以存储中间结果。
The following REORG example reorganizes the customer table using the system temporary tablespace TEMPSAPCE1 as a work area to store the intermediate results.
考虑对所有小于52kb的表进行自动表重组,在线执行所有索引重组,并在重组时使用系统临时表空间。
Consider all tables for automatic table reorganization that are smaller than 52kb, perform all index reorganizations online, and use a system temporary table space when doing reorganization.
使用为基线数据的每会话存储创建的全局临时表(CGTT)(对于每个表函数,使用一个 CGTT)。
Use a created global temporary table (CGTT) for per-session storage of the baseline data (use one CGTT per table function).
诊所通常并不随时在线,因此必须保证可靠地交付日程表,甚至使用者临时断开连接也应如此。
The medical offices aren't typically always online, so the reliable delivery of the agenda must be guaranteed even when the consumers are temporally disconnected.
所有DB 2表空间都可以使用这个选项,包括系统表空间和临时表空间,以及数据库管理的表空间。
This option is available for all DB2 tablespaces, including system and temporary tablespaces and database managed tablespaces.
优化器然后使用复合索引将临时表连接到事实表,来快速定位在维度表中满足条件的行。
The optimizer will then join that temp table to the fact table using the compound index to quickly locate the rows that satisfy the criteria on the dimension tables.
如果跟踪模式没有被设为OFF(即默认情况),那么将使用下面的名称和格式,把每个入口、出口和非零s QL代码都记录到一个全局临时表中。
If the trace mode is not set to OFF (which is the default), then each entry, exit and non-zero SQL code will be logged in a global temp table with the following name and format.
临时dbspace:临时dbspace属于常规dbspace,数据库服务器在存储临时表时将使用到它。
Temporary dbspaces: : a temporary dbspace is a regular dbspace, used by the database server to store temporary tables.
使用像CCleaner这样的软件来删除临时的和无用的文件,它可以修复注册表。
Delete temporary and unused files on your computer using a free program like CCleaner. It can also fix issues with your registry.
清单2将为新创建的全局临时表创建一个公有别名,以便于可以使用gtt _ test来引用它,而不需要限定表名。
Listing 2 creates a public alias for the newly create global temporary table so that it can be referred to as gtt_test without having to qualify the table name.
应用推荐