是否可以将 Informix 临时表与通过 sysmaster 创建它的会话关联起来?

发布于 2024-11-25 05:32:22 字数 268 浏览 1 评论 0原文

通过systabnamessystabinfosysdbstab,生成临时表(和哈希临时排序)和空间量的列表相当简单他们目前正在消费。

但是,当您有许多用户/进程运行相同的 SQL 并生成具有相同名称的临时表时,您最终会得到看起来高度重复的输出。

sysmaster 中是否有一个表,通过该表可以将临时表的partnum 与创建它的会话 关联起来?

Via systabnames, systabinfo and sysdbstab, it's fairly straightforward to produce a list of temp tables (and hash-temp sorts) and the amount of space they're currently consuming.

But when you have many users/processes running the same SQL and generating temp tables with the same name, you wind up with what appears to be highly duplicate output.

Is there a table in sysmaster via which the partnum of the temp table can be associated to the session that created it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

许一世地老天荒 2024-12-02 05:32:22

过去几年,这个问题在其他 Informix 相关论坛上被多次提出,但没有一个真正令人满意的答案。

您可能熟悉以下形式的某些变体:

SELECT hex(i.ti_partnum) partition,
       trim(n.dbsname) || ":" || trim(n.owner) || ":" || trim(n.tabname) table,
       i.ti_nptotal allocated_pages
  FROM sysmaster:systabnames n, sysmaster:systabinfo i
 WHERE (   sysmaster:bitval(i.ti_flags, "0x0020") = 1
        OR sysmaster:bitval(i.ti_flags, "0x0040") = 1
        OR sysmaster:bitval(i.ti_flags, "0x0080") = 1
       )
   AND i.ti_partnum = n.partnum
   AND i.ti_partnum > 0

应该使用 JOIN 表示法将其重写为:

SELECT hex(i.ti_partnum) partition,
       trim(n.dbsname) || ":" || trim(n.owner) || ":" || trim(n.tabname) table,
       i.ti_nptotal allocated_pages
  FROM sysmaster:systabnames n
  JOIN sysmaster:systabinfo i
    ON i.ti_partnum = n.partnum
 WHERE (   sysmaster:bitval(i.ti_flags, "0x0020") = 1
        OR sysmaster:bitval(i.ti_flags, "0x0040") = 1
        OR sysmaster:bitval(i.ti_flags, "0x0080") = 1
       )
   AND i.ti_partnum > 0

但这仅提供您已经了解的信息。

我确实发现了一种使用 onstat -g opn 来检测打开的分区的技术,这些分区以某种方式通过 onstat -u 连接回会话。不幸的是,onstat -g opn 报告的数据无法从 SMI 和 sysmaster 获得,因此这属于“ON-Stat 输出的脚本分析”类别。如果您希望我从一个不起眼的电子邮件帐户档案(大约 2007 年,IIRC)中挖掘详细信息,请发表评论。

This question has been asked on a number of occasions over the past few years in other Informix-related forums, and there isn't a truly satisfactory answer.

You are probably familiar with some variant of:

SELECT hex(i.ti_partnum) partition,
       trim(n.dbsname) || ":" || trim(n.owner) || ":" || trim(n.tabname) table,
       i.ti_nptotal allocated_pages
  FROM sysmaster:systabnames n, sysmaster:systabinfo i
 WHERE (   sysmaster:bitval(i.ti_flags, "0x0020") = 1
        OR sysmaster:bitval(i.ti_flags, "0x0040") = 1
        OR sysmaster:bitval(i.ti_flags, "0x0080") = 1
       )
   AND i.ti_partnum = n.partnum
   AND i.ti_partnum > 0

which should be rewritten using JOIN notation as:

SELECT hex(i.ti_partnum) partition,
       trim(n.dbsname) || ":" || trim(n.owner) || ":" || trim(n.tabname) table,
       i.ti_nptotal allocated_pages
  FROM sysmaster:systabnames n
  JOIN sysmaster:systabinfo i
    ON i.ti_partnum = n.partnum
 WHERE (   sysmaster:bitval(i.ti_flags, "0x0020") = 1
        OR sysmaster:bitval(i.ti_flags, "0x0040") = 1
        OR sysmaster:bitval(i.ti_flags, "0x0080") = 1
       )
   AND i.ti_partnum > 0

But this only gives the information that you already know about.

I did find a technique reported using onstat -g opn to detect open partitions that somehow connected back to the sessions via onstat -u. Unfortunately, onstat -g opn is reporting data that is not available from SMI and sysmaster, so this would fall in the category of 'scripting analysis of ON-Stat output'. If you want me to dig the details, such as they were, out of an obscure email account's archive (circa 2007, IIRC), then leave a comment.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文