0

I'm debugging performance problems with my DB and see some unusual entries in the DB log:

2021年04月21日 01:07:33.857 UTC [14823] user@db LOG: duration: 933645.469 ms plan:
Query Text: select systemv0_.id as id1_11_0_, systemv0_.createdTs as createdT2_11_0_, systemv0_.systemType as syste3_11_0_, systemv0_.foundProblemsCount as foundPro4_11_0_, systemv0_.groupid as groupid8_11_0_,... (rest omitted for brevity)

What are these strange identifiers with numbers and underscores? Normally an execution plans has clear names and identifiers such as systemview.id.

My hypothesis is that there are several concurrent queries and the performance issues are due to the DB desperately trying to remain consistent under low memory conditions. I noticed a couple suspicious things in other queries - several Recheck Cond and Materialize tree nodes, which appear to be often happening due to insufficient size of some DB buffers (caused by low host memory?). It would be nice if someone could confirm or debunk my theory.

asked Apr 29, 2021 at 23:23
0

2 Answers 2

1

select systemv0_.id as id1_11_0_
, systemv0_.createdTs as createdT2_11_0_
, systemv0_.systemType as syste3_11_0_
, systemv0_.foundProblemsCount as foundPro4_11_0_
, systemv0_.groupid as groupid8_11_0_
,...

"systemv0_" might be a table name (but I suspect that's unlikely).
"systemv0_" might be a Correlation Name (or "alias") for real table (as in select ... from table1 as systemv0_).

This kind of "weird-looking aliasing" is very common with Object-Relational-Mapping (ORM) tools, which I suspect is what generating this query. Rest assured, there is nothing "nasty" happening inside your database.

Sure, this query looks odd to you and me but, to your DBMS, it's no different from the bread-and-butter "select * from table1" style query that we would write by hand. (Not that you'd use "select *" in application code, of course).

answered Apr 30, 2021 at 11:53
1

Those are not the table names, but aliases. You can use them to make a query more readable:

SELECT some.col1, another.col2
FROM some_really_long_table_name AS some
 JOIN another_terrible_table_name AS another
 USING (col3)
WHERE some.col4 = 42;

But of course you can also abuse aliases to obfuscate and inflate a query, as some object-relational mappers do.

answered Apr 30, 2021 at 3:09

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.