These are chat archives for ManageIQ/manageiq/performance

29th
Jan 2019
Keenan Brock
@kbrock
Jan 29 17:03
ugh
trick question:
how many queries is this? (note, I do not update the record)
c = Classification.last
c.save
1 query for the select, 2 round trips for the begin / commit... so that seems like 3? maybe? (perfect world has no begin/commit but...)
answer: 13
ms qry ms sql
0.8 0.6 .SELECT "classifications".* FROM "classifications" ORDER BY "classifications"."id" DESC LIMIT $1 [1]
0.3 0.3 .BEGIN []
0.6 0.6 .SELECT 1 AS one FROM "classifications" WHERE ("classifications"."id" BETWEEN $1 AND $2) AND "classifications"."parent_id" = $3 AND "classifications"."description" = $4 AND ("classifications"."id" != $5) LIMIT $6 [0, 999999999999, 142, "Migrated", 143, 1]
3.3 0.4 .SELECT "tags".* FROM "tags" WHERE "tags"."id" = $1 LIMIT $2 [145, 1]
0.8 0.6 .SELECT "classifications".* FROM "classifications" WHERE "classifications"."id" = $1 LIMIT $2 [142, 1]
0.4 0.3 .SELECT "tags".* FROM "tags" WHERE "tags"."id" = $1 LIMIT $2 [144, 1]
0.6 0.4 .SELECT "classifications".* FROM "classifications" WHERE "classifications"."id" = $1 LIMIT $2 [142, 1]
0.8 0.6 .SELECT "tags".* FROM "tags" WHERE "tags"."id" = $1 LIMIT $2 [144, 1]
0.6 0.5 .SELECT "tags".* FROM "tags" WHERE ("tags"."id" BETWEEN $1 AND $2) AND "tags"."name" = $3 LIMIT $4 [0, 999999999999, "/managed/transformation_status/migrated", 1]
0.5 0.5 .SELECT 1 AS one FROM "classifications" WHERE (tag_id = 145 and id <> 143) LIMIT $1 [1]
0.7 0.5 .SELECT "classifications".* FROM "classifications" WHERE "classifications"."id" = $1 LIMIT $2 [142, 1]
1.3 0.8 .SELECT "tags".* FROM "tags" WHERE "tags"."id" = $1 LIMIT $2 [144, 1]
0.8 0.8 .COMMIT []
Nick LaMuro
@NickLaMuro
Jan 29 17:06
:sob:
Adam Grare
@agrare
Jan 29 17:09
D. All of the above
from before_save :save_tag in Classification
Nick LaMuro
@NickLaMuro
Jan 29 17:14
@kbrock oh look, there was a performance improvement since fine on that too! We used to do 14 queries :trollface:
progress!
NickLaMuro @NickLaMuro had fine checked out locally when he was testing this
Keenan Brock
@kbrock
Jan 29 17:15
yea, the new classification change (working on it now) actually decreases it :(
this is such a tangent. but hard to let things like this go :(
Jason Frey
@Fryguy
Jan 29 18:15
WAT
Joe Rafaniello
@jrafanie
Jan 29 18:45
That's amazing