Work Items API performance WG - 2025-03-18 — Transcript
Full transcript
- 0:03yeah hey everyone this is a work items
- 0:06performance API working group today is
- 0:08March
- 0:0918 um so yeah let's start with the
- 0:13updates I verbalized for Eugenia who can
- 0:15join she's still working on the N plus
- 0:18ones uh from the linked items widget uh
- 0:21and she needed to change the approach uh
- 0:25for a technical reason uh but yeah uh
- 0:29still need to try a different solution
- 0:32this week uh and yeah Alexandro you have
- 0:35a next
- 0:38up yeah so from from our last discussion
- 0:41I was encountering this uh huge overhead
- 0:44from graphql versus what I was seeing
- 0:47from the database uh I paired with
- 0:49Hinrich we didn't see anything that
- 0:53could be improved right away but then
- 0:55like afterwards I I realized that they
- 0:58enabled method for the bullet doesn't
- 1:01actually disable it it just changes some
- 1:04of the on the level of the uh logging CU
- 1:08like I disabled Bullet by disabling the
- 1:10enabled method um and then I realized
- 1:13that's not the one that doing it so just
- 1:16disabling the bullet locally uh got the
- 1:20query to execute from 10 plus seconds
- 1:23seconds to around one and a half second
- 1:26uh that's definitely a huge Improvement
- 1:30uh but it's still I think there is still
- 1:32room to improve it even from 1.5 seconds
- 1:35if you consider that the the postgress
- 1:38part the the database part is
- 1:41taking pretty much always under 50
- 1:44milliseconds locally so it there's
- 1:46should be no reason to have a 30X I
- 1:49think a 10x should be achievable I would
- 1:51say but um I didn't get to spend more
- 1:55much more time on that afterwards uh so
- 1:59I I don't know if we can achieve it or
- 2:02not but like from a very high level
- 2:05perspective that that does sound
- 2:06reasonable to me so maybe maybe I'll get
- 2:09to spend a bit more time again uh into
- 2:11trying to see if I can get it down from
- 2:131.5 to a bit
- 2:16lower do you have any guess where we
- 2:20spent the most of the time uh yeah the
- 2:23time was spent after
- 2:25fetching the uh the data from the
- 2:29database right so not not like parsing
- 2:31the the query itself didn't seem to take
- 2:35that much time it was like all of this
- 2:37was mostly happening afterwards like
- 2:39cing the data and then trying to render
- 2:41that whole tree and that I guess that's
- 2:43where bullet kind of kicked in as well
- 2:46and and it was trying to do some logging
- 2:48tracking and all that so it was adding
- 2:51um more overhead to whatever was already
- 2:55there so okay then my suggestion to try
- 2:59pre compiled Cruise doesn't help any
- 3:02with
- 3:04anything I I I think everything helps I
- 3:06don't know though how much right like
- 3:08that that's something if it's like below
- 3:09100 milliseconds for one and a half
- 3:11seconds it's it's not the thing that we
- 3:13are looking at yeah yeah I can try it
- 3:15out and see if that like how much that
- 3:18shaves off of that 1. half 1.5 seconds
- 3:21again that's what that 1.5 seconds it's
- 3:24not like set in stone it's sometimes 1.3
- 3:26sometimes it's two seconds it's like it
- 3:28ver it's hard to to measure sorry
- 3:31H yeah regarding parsing we also log
- 3:34this right now in our graphql logs so we
- 3:37have some data here to see how much we
- 3:39could save uh yeah last time I checked
- 3:43it was a pretty small number because I
- 3:44was looking at because we had random
- 3:47like validation timeouts right during
- 3:49these parsing and like some people were
- 3:51encountering that so I saw that they
- 3:53were like very small numbers but then
- 3:56some it just happens I don't know like
- 3:58some GC happens or whatever right it
- 4:00goes over the time out but yeah I just
- 4:02wanted to add also another thing
- 4:04regarding the profiling you're doing
- 4:05like sometimes it's also tricky to do
- 4:08profiles on the local environment um
- 4:12especially you know running rails and in
- 4:15development could like you know behave
- 4:17differently so it might be worthwhile
- 4:20testing in like staging or something I
- 4:22don't know just a suggestion
- 4:29yeah so like for for validation where we
- 4:32are tracking it we have a timeout of 0.2
- 4:35seconds so around 200 millisecond so if
- 4:38I guess if parsing would not fit within
- 4:41those 0.2 seconds it will fail somehow
- 4:46so yeah I don't know how much we can we
- 4:48can gain from from just
- 4:51cashing I mean we we will gain but we
- 4:53are not yet at that point of saving like
- 4:56I don't know 50 more milliseconds or
- 4:58something like that right
- 5:04maybe a stupid question but what is
- 5:07bullet it's it's a gem to track n plus
- 5:12ones um it's a development gem that we
- 5:15only like we enable it on development to
- 5:17track on plus ones it will highlight
- 5:19that if you have some of
- 5:22them do you want to try this idea that
- 5:25HRI just suggested of profiling on
- 5:27staging or some other environment
- 5:33uh I can I can take a look at it uh
- 5:36again I
- 5:38don't uh anything specific that I would
- 5:42want to look into just just check the
- 5:46timings on stage yeah it's more like my
- 5:49question is about like you know is the
- 5:51difference in cre time versus response
- 5:53time only visible in Dev or also in
- 5:55production M so just so we you know rule
- 5:58out any development
- 6:00uh uh thing yeah I I guess I can run
- 6:03some flame graphs on staging as well
- 6:07right like against staging the the
- 6:09problem though is that locally I can
- 6:11tweak my qu I guess I can tweak the
- 6:14query for staging as well yeah I
- 6:16probably can do that I probably can do
- 6:19that um CU I was like eliminating all of
- 6:22those uh widgets that create n plus ones
- 6:25and and some of the permissions so
- 6:27probably I can I can customize the query
- 6:29just so that it it fits whatever I'm
- 6:32doing locally yeah I'll I'll I'll give
- 6:34it a try I'll take a
- 6:44look there
- 6:46go so yesterday I paired with uh met uh
- 6:51on the nonmembers issue it's kind of
- 6:54hard to test it locally locally we don't
- 6:56see the the performan error as as big of
- 7:01a difference as we see in production in
- 7:03production is very
- 7:04explicit uh good idea in to testing
- 7:09staging as well I'll try to say that but
- 7:13also mat found something later uh and
- 7:17Nicholas just mentioned that we had that
- 7:19similar optimization already done
- 7:21somewhere else so I'll try that today to
- 7:23apply that optimization on this query
- 7:26there and see if we can find something
- 7:32want to quickly mention something that's
- 7:35okay we recently merged uh NMR to fix
- 7:39some of the permissions Pro permission
- 7:41problems for advanced search in relation
- 7:43to epex but I think we also improve the
- 7:46performance quite a bit so we use a tree
- 7:49structure for group level searches and I
- 7:52can share the mrr maybe we can pull some
- 7:55of the changes from that Mr and make
- 7:58this optimization
- 8:00more generic let's say so I will post it
- 8:08here sure let's do on
- 8:13Mr this
- 8:18one so we've we we're using some unique
- 8:23things to make group level searches
- 8:25performant because sometimes we have too
- 8:28many epics too many groups the hierarchy
- 8:31is so large so usually we use a tree
- 8:35structure so we build permission tree
- 8:39essentially and optimize it as much as
- 8:42possible so if you have maybe access to
- 8:45gab or 970 you don't really need any
- 8:49other permissions down the line you know
- 8:51that you have access to everything so
- 8:54you can just
- 8:55shortcut all the permission checks and
- 8:58make it much more efficient just wanted
- 9:00to mention it
- 9:03here yeah that's basically similar to
- 9:06the optimization we did for epics which
- 9:08traverses the tree and kind of like
- 9:10shortcuts the children if uh some
- 9:12condition is met so I think it's good to
- 9:15like look into that and generalize this
- 9:18uh solution into yeah something reusable
- 9:21I also attach the tree structure we are
- 9:23using here because I'm not sure if we're
- 9:26using that for epics or anywhere else
- 9:30apart from advanced search we have an in
- 9:33progress andr for some I think
- 9:36pages settings so i' recommend using
- 9:39this tree structure there and it make
- 9:42made it much more
- 9:44efficient so instead of plus one it's
- 9:46one
- 9:48query uh this is not something to answer
- 9:51here but just like as an idea because
- 9:56this feels to me very similar to our
- 9:59project authorizations just done at the
- 10:01group level obviously the implementation
- 10:04will be different because we need to
- 10:05care now about a three of nodes rather
- 10:08than a flat list of projects but do you
- 10:13think it makes sense because what I what
- 10:15I understand is we will compute this
- 10:19authorization tree basically every time
- 10:21we want to search something right so we
- 10:23would first compute whatever the tree
- 10:26for authorizing these groups should look
- 10:29like if I have the top level group that
- 10:31I only need that part and so on but we
- 10:34would do it every time you want to
- 10:35search it so instead of doing that maybe
- 10:38we can I don't think it changes all that
- 10:40often so maybe it makes sense to to also
- 10:43cash it so you don't have to comput it
- 10:45every time you want to filter or search
- 10:48but you do it once and then you update
- 10:50it whenever the membership or the
- 10:52permissions change as well um so it's
- 10:56kind of more of a longer term caching
- 10:58rather than caching right before you
- 11:00want to do it cuz I would
- 11:03assume it does get expensive in in some
- 11:06scenarios as well to to compute this
- 11:08three so most of the time we compute it
- 11:11for a specific user so it's not the
- 11:14entire hierarchy we're Computing that
- 11:16but maybe you have access to several
- 11:19subgroups in a namespace so we calculate
- 11:22this tree for this specific user so we
- 11:25don't have to Traverse the entire uh the
- 11:28entire namespace tree the entire
- 11:32hierarchy so we kind of flipped
- 11:35the checks if that makes sense and made
- 11:37it much more performant yeah yeah what
- 11:40I'm trying to say is like does it make
- 11:43sense to to kind of have this cached
- 11:45already for the user right because you
- 11:48we kind of know this user is part of
- 11:50these groups so you can have it
- 11:52precomputed basically for for that user
- 11:55and whenever that user is removed or
- 11:57added to a different group you can you
- 11:58can always always kind of recompute it
- 12:01have it there and whenever you need to
- 12:03do a search you just fetch it without
- 12:04having to compute it every time right so
- 12:07it kind of feels natural but I don't
- 12:09know if there is any anything to be
- 12:11aware of or or or scared or yeah maybe
- 12:15that could be an optimization for later
- 12:18time but I think we haven't encountered
- 12:20any issues with loading user kind of
- 12:24permissions I think it was extremely
- 12:26efficient compared to in the entire
- 12:30namespace hierarchy let's say so maybe
- 12:33if we see that this becomes a problem we
- 12:35can cach it but we probably shouldn't
- 12:37catch it unnecessarily if that makes
- 12:42sense yeah sounds
- 12:46good would that solve uh the permissions
- 12:51problem we discussed in the very
- 12:53beginning uh like for everything andri
- 12:57how how much how long does it take to
- 13:00build that tree is it like 50 100
- 13:04milliseconds I think less than 100
- 13:07milliseconds but I I haven't checked it
- 13:09recently we can we can double check
- 13:11maybe after we merged thism more we can
- 13:14we can even get some maybe even
- 13:16production
- 13:19numbers I I think it will help but it
- 13:21will not completely solve it um because
- 13:25like if we take the scenario where we
- 13:28computed and we figure out that we we
- 13:31this user has access into like 100
- 13:35different groups right and you need to
- 13:37query anyway then then the queries do
- 13:40become slow anyway because they need to
- 13:42load all the issues for all this 100
- 13:44name spaces sort them in a specific
- 13:47order and only then pull the like the
- 13:49top 100 or top a th whatever so so
- 13:53that's one part of the optimization that
- 13:55is probably going to help quite a bit I
- 13:57would assume but it's not the full the
- 13:59full picture right um so we still need
- 14:02to figure out how do we make the the
- 14:06query fast enough in in those particular
- 14:10scenarios yeah I think it doesn't really
- 14:12solve the query problem unless you're
- 14:14sending a huge maybe group ID list so if
- 14:19you if you try to send thousands of
- 14:21group IDs to filter documents it also
- 14:23becomes really slow we've encountered
- 14:26that with non-group based document types
- 14:30so if you just call I don't know do all
- 14:34projects on a namespace and send this
- 14:36entire list it's really inefficient so
- 14:40that's why we started switching to group
- 14:42based filtering so we are trying to
- 14:44filter it by group first and then
- 14:47projects only if necessary maybe have
- 14:50access to some specific
- 14:52projects across the entire group so we
- 14:55have Traverse Traverse IDs prefix and
- 14:59some additional authorized projects on
- 15:02top of
- 15:04that I think it should be still pretty
- 15:07efficient and I would imagine that for
- 15:09most customers it's not hundreds of Nam
- 15:12spaces they have access to it's maybe
- 15:15several
- 15:18namespaces so I think that's what makes
- 15:20it much more
- 15:25efficient yeah but the way I understand
- 15:27that we can't really
- 15:29search issues at the moment or work
- 15:32items for projects just by the group ID
- 15:34like we don't have the traversal ID or
- 15:36anything like this right so right now
- 15:40for work item set still will be the
- 15:42project list in the
- 15:44end or am I wrong I think right now
- 15:49sorry
- 15:51yeah I I just want to mention that right
- 15:54now we're searching work items I think
- 15:57using troversial IDs if it's if you
- 16:00select a project then we filter it by
- 16:03project ID but if it's a group search I
- 16:06think we mostly rely on pre prefix and
- 16:08traversal
- 16:11IDs like even for projects who can use
- 16:13traversal IDs because a project has a
- 16:15namespace record which then in turn has
- 16:18the traversal IDs uh column as well
- 16:22so I don't think it makes a difference
- 16:25just because projects are always a leaf
- 16:27node so so like there is no much use
- 16:32basically in having that project ID
- 16:34within the traversal ID list because
- 16:36it's always going to be the last one so
- 16:39yeah that I don't know if that helps uh
- 16:43maybe there is some other tweak there
- 16:44where we can still get some performance
- 16:47out of that but other otherwise it feels
- 16:50like sending the traversal IDs after
- 16:53this project ID or just using the
- 16:55project ID is kind of the same thing
- 16:57because it's always the last the last
- 16:59node in the
- 17:01list yeah I for some reason thought that
- 17:03we don't have it at all uh for work
- 17:06items so great to hear that we do uh
- 17:09then kind of final question for me do we
- 17:13does anyone wants to take it as a to-do
- 17:16to look into DMR and see how we can
- 17:18adopt it for work
- 17:26items I'd love to take a look but I
- 17:29don't think I'll have capacity to do it
- 17:31this week because I do have to work on
- 17:34some other stuff as well um but like I
- 17:38can put it on my to-do list I don't
- 17:42know um like do I need to commit to it
- 17:45being like an investigation that I Do by
- 17:49XY Z like I I'd like to know how can I
- 17:52like what kind of priority I need to
- 17:54give it and then how I structure my
- 17:56other work uh out on on top of this or
- 18:00or or or this within the other work that
- 18:03I need to
- 18:09do I mean if sorry Nicholas you wanted
- 18:13to say
- 18:13something for me it's the same answer as
- 18:16Alexandro but Casio and Matt you
- 18:18actually looking into this right so you
- 18:20can first try to try to fix it we
- 18:23already have and then look that was that
- 18:26was my idea yeah I'll try to fix with
- 18:28what we have and since it's similar I'll
- 18:31take a look as well but I I wouldn't
- 18:33like to make a commitment on really
- 18:35going deep on that because I have other
- 18:36stuff as well it's actually the same
- 18:40answer so so maybe we'll leave this to
- 18:43as a next point to our next meeting like
- 18:45no one has to take it on but then by the
- 18:48by the next meeting we'll also know a
- 18:50little bit more about our workload and
- 18:52and who's doing what cuz like again I if
- 18:55I try to test that on staging and what
- 18:57not it will take me some time that's one
- 19:00point that I can bring up to the next
- 19:01meeting then if I'm done with that I can
- 19:04probably pick up this one as the next
- 19:07item that I can look into if someone
- 19:09else is didn't try it or or someone or
- 19:11something like that so what do you think
- 19:12about that like maybe we postpone it one
- 19:15week unless we have capacity to someone
- 19:18to to pick it up it doesn't seem like
- 19:20that I think Eugenia has something on
- 19:22her play and Alisa has something as well
- 19:25on her play so
- 19:27yeah yeah sounds good uh let's postpone
- 19:31it to the next one um my only ask
- 19:35Dimitri can you open a like placeholder
- 19:37issue for it and ping me on it just I
- 19:40don't know reference Mr I'll put it
- 19:43somewhere in the plan so we don't lose
- 19:45the idea all right sounds good
- 19:51thanks Henrik you have an next Point
- 19:54yeah so I continued looking at the
- 19:56queries and I was like we had an issue
- 19:58for the band user thing so I looked into
- 20:00that and I tried I posted there I tried
- 20:03using a CTE to force it to uh evaluate
- 20:06the band users last U because my initial
- 20:10assumption was postgress was trying to
- 20:12do the wrong thing right but um yeah
- 20:16with the CTE it was fast but I
- 20:18realized I didn't put the order Clause
- 20:22at the uh outer query uh Nicholas you
- 20:25have a question around it and um found
- 20:28out about it because the specs fail and
- 20:31I read the docs and it says
- 20:34that um I saw some like Forum post that
- 20:38said like the order is preserved in a
- 20:40CTE but it's not like you know you you
- 20:44shouldn't rely on it being like that
- 20:46like it's like a side effect rather than
- 20:48like an intended Behavior oh
- 20:51post okay yeah I have to confirm but
- 20:53that's what I remember seeing and then
- 20:56the specs also said that it wasn't
- 20:58returned in order right so there must be
- 20:59something maybe in the newer version
- 21:01it's already not ordered or something I
- 21:03don't know but
- 21:05um but yeah that was so that didn't work
- 21:09but also while investigating I saw
- 21:12interesting data like for gab.com we
- 21:15actually have over one million ban users
- 21:18and that's part of the problem why the
- 21:19post chooses a bad plan um it doesn't
- 21:22try to do it last because the band users
- 21:24is also a big uh
- 21:26table um
- 21:29I saw a solution
- 21:32where
- 21:34the projects I don't know who was who
- 21:37was doing the project thing where
- 21:39like a band users projects are deleted
- 21:42after 60 days um is the new thing that
- 21:45someone else is working on some other
- 21:47team is working on right now so we could
- 21:49do a similar thing where after 60 days
- 21:52we delete the use uh the users issues
- 21:54authored issues and then we Mark the ban
- 21:57user record as like you know issues
- 21:59deleted or something so when we do the
- 22:01exist Clause we only include band users
- 22:04where um issues deleted equals false
- 22:08right so these are like the newly banned
- 22:10users I don't know if it would help it's
- 22:12just like a thought Theory at this point
- 22:15but yeah um that's one possibility and
- 22:19the other thing I tried that kind of
- 22:22works it's like to add an index a
- 22:25partial index with a like where work
- 22:28item type ID is in the like the default
- 22:31types then the band users filter is also
- 22:33fast in that case
- 22:35because um it uses the Sorting already
- 22:38on that first organizm type ID filter so
- 22:41basically the problem I see is that we
- 22:43have these filters that aren't really
- 22:45filtering out that many issues right
- 22:48there's like it adds a clause but then
- 22:50doesn't filter out many
- 22:52um rows that's the band users filter and
- 22:56also the workm type because like most
- 22:59are issues right and we're just adding
- 23:01that clause which you know post has to
- 23:03work through but then not filter out
- 23:05anything um yeah Alexander you have a
- 23:09question yeah I wanted to like do you
- 23:13know if we are ever deleting these band
- 23:17users um and and like we have the band
- 23:19users table where we would retain some
- 23:23of the maybe dat metadata of this user
- 23:25like the email that they use so we don't
- 23:27allow them to be creating another
- 23:30user as a different like I don't know
- 23:32username and stuff like that but then
- 23:34like it kind of makes sense to delete
- 23:37the users records because then we don't
- 23:39have to to join those users or things
- 23:42like that I I don't know so like I want
- 23:43to to try and cut down on the amount of
- 23:47the at least Mill because this is going
- 23:49to only grow right like this is never
- 23:51going to to be um deleted because we
- 23:54want to retain these uh abuser users or
- 23:57whatever uh band users list but we
- 24:00should not have to always join with this
- 24:03this table because this is going to
- 24:05become more and more of a problem on
- 24:08every level where we where we need to to
- 24:10filter out meta like data from band
- 24:14users yeah so I haven't checked with the
- 24:17abuse team about their like like how
- 24:20they use these band user table and if if
- 24:22you know if ever these ever get deleted
- 24:25or it's just going to just grow um but
- 24:28yeah like I said one idea to make the
- 24:31table or like the list of IDs smaller
- 24:34when you filter out is to add another
- 24:35column like an issues deleted something
- 24:38but yeah it adds extra overhead I guess
- 24:42but with an index you can easily find
- 24:43the ones that you need to filter out
- 24:45maybe I don't know but yeah I don't know
- 24:49if it will help because you still need
- 24:51to join on the band user so you kind of
- 24:55need to filter by those users anyway I
- 24:59don't know like we need to to look at a
- 25:01plan uh but
- 25:04yeah it will be like just nice to not
- 25:07have to join with that table as well
- 25:09like if you are removing B like banned
- 25:12user data every now and then you don't
- 25:15even need to join on that like you'll
- 25:17slip in some of the bad issues so to say
- 25:20right periodically but if you constantly
- 25:24clean it up you don't even have to join
- 25:27that table because eventually you'll
- 25:29clean up that bay data anyway but yeah
- 25:32anyway yeah but there are like yeah some
- 25:34ux concerns like you know like a spammer
- 25:36like spams 30 issues and it shows up in
- 25:39your issue list you don't want to wait
- 25:4130 days until it you know uh gets off
- 25:44your list
- 25:46but but yeah the other approach I was I
- 25:49am looking into right now is like
- 25:51indexing the recent type IDs
- 25:55um by the default list although I think
- 25:58I'm gonna try to figure out with Jack I
- 26:02think Jack's working on the Consolidated
- 26:04list right I'm not really sure around
- 26:06the plans on like our requirements never
- 26:10going to show up in the Consolidated
- 26:11list or you know around these types so
- 26:13we know how to index our data and like
- 26:16do we need to filter by type or you know
- 26:20because right now I think we exclude two
- 26:21types is I think it's requirement and
- 26:24test case or some one one other you know
- 26:27type um
- 26:30and yeah because they have their own
- 26:32like list page and
- 26:37yeah yeah Nicholas has a question on
- 26:40yeah I was wondering Dimitri how does
- 26:42the search team uh work with the band
- 26:45users
- 26:47data so I think we just don't index band
- 26:51users data because you cannot really do
- 26:54joints in elastic search so we just
- 26:57don't have these documents in the first
- 27:00place but the user can be banned after
- 27:02they created the issue so what do you do
- 27:04then I think we remove it I will need to
- 27:07double check but I'm pretty sure we just
- 27:09drop all the associated
- 27:16data yeah with postgress indexes though
- 27:19we can't like add a you know wear Clos
- 27:22they're like referencing another table
- 27:24right so that's why it's kind of tricky
- 27:27we'd have to denormalize it into this
- 27:29table and like that
- 27:32so if we want to do this similar
- 27:44thing what happened with the idea of
- 27:46denormalizing
- 27:50it um I still it's still on the table
- 27:53but then it's just it takes more work
- 27:56it's like riskier right it's uh you need
- 28:00to do the syn uh invalidating the thing
- 28:06when the users unbanned
- 28:10and yeah and like the normalizing
- 28:14usually the normalizing usually means we
- 28:16all store the same data multiple times
- 28:19which is we we already have a problem of
- 28:23uh too large of a database I don't know
- 28:25how much data that adds and how much
- 28:28performance we gain but just as another
- 28:30perspective is like we try to like to
- 28:33add all of this retention stuff to
- 28:35remove data from the database and
- 28:37denormalizing usually means basically
- 28:40increasing the data that that we
- 28:43store um I was wondering if we could do
- 28:47an optimization by normalizing not on
- 28:50the issues table but on the namespace
- 28:53table um so hear me out so what if we
- 28:57have this data tension policy and after
- 28:59X hours we delete issues from any band
- 29:03user and we know that these band users
- 29:05created issues in these projects or
- 29:09groups and we therefore like once they
- 29:13got deleted we Mark these projects again
- 29:16as safe like not having any work items
- 29:19from band users and then we don't need
- 29:21to join it if we only do this on a group
- 29:24top level Nam space Maybe
- 29:28like the cre performance suffers while
- 29:31there's an attack from Bann
- 29:34users like that users we will ban but
- 29:37once we ban them and deleted the content
- 29:39we do not need to quy anymore
- 29:42the the data from like we don't need to
- 29:45do the chin
- 29:48anymore it's basically storing a uh has
- 29:52hidden issues Boolean on the on the top
- 29:55level container or something right there
- 29:59it's a a denormalization only on the top
- 30:02level Nam name space instead of per
- 30:09issue so this what also could could work
- 30:12with workers right like you you have a
- 30:16sidekick chop I mean that's a bit too
- 30:19much but like you go through all top
- 30:20level name spaces check if there is band
- 30:22users and if it's not you don't need to
- 30:25create but like you need to yeah it's a
- 30:28bit too much
- 30:30but maybe denormalization not on issues
- 30:32table could help because then you remove
- 30:35the remove it depending on if there is
- 30:37current data in
- 30:41it but this also depends on you want to
- 30:46delete the issue records right because
- 30:49that's when you flip the has hidden
- 30:51issues back to yeah if that's something
- 30:55we want to do or not maybe it's safe to
- 30:57do right it's all spam mostly I guess
- 31:00after X number of days exactly it's spam
- 31:04didn't get unbanned and and my thinking
- 31:05is the following so well gitlab orc
- 31:08would suffer for some time period where
- 31:11we until we delete the stuff all the
- 31:13other groups that are private anyway and
- 31:15do not have banned users do not need to
- 31:17suffer anyway and we could enable that
- 31:19for them immediately we would have
- 31:22one time migration where we go for all
- 31:25band users and check which namespaces
- 31:27have B users in there and we need to
- 31:29keep this up to date yes like have sorry
- 31:32which yeah which spaces have issues of B
- 31:34users in there and then once we do this
- 31:37and keep this up to date we can remove
- 31:39the query from all other namespaces
- 31:41except where it is and then maybe we
- 31:44have the data
- 31:48retention it seems like I was wrong
- 31:50about our
- 31:52approach we just store hidden
- 31:55field work so
- 31:58that's our solution how do you update
- 32:01keep it up to date uh I think just using
- 32:04the regular index and pipeline so if a
- 32:07user is marked as baned I think we just
- 32:11go and update all all the associated
- 32:14records all the associated
- 32:18documents it's kind of unique for
- 32:20elastic search because it's very
- 32:21efficient to filter out these hidden
- 32:24work items
- 32:31yeah so that's basically similar to the
- 32:33original idea of the normalizing it at
- 32:35the pr work item level right
- 32:40yeah so so like I think if we decide
- 32:44this is a good thing then we can split
- 32:46it in two parts first one is doing the
- 32:49denormalization which I hope we can move
- 32:51it to the abuse team right they can add
- 32:55the the uh column to the namespaces
- 32:58table they can mark that namespace table
- 33:01when they detect an abuse user and so on
- 33:04so like because this doesn't relate as
- 33:06much
- 33:07to plan per se it's more onto like how
- 33:11do we detect band users and when can we
- 33:14Mark um some of these containers as
- 33:17having or not having band users data
- 33:21hopefully they can take it I don't know
- 33:23um but I don't know if we can rely on
- 33:26that cuz that's that's something that we
- 33:27use we use depends like how you want to
- 33:31implement it right you could like
- 33:33denormalize a has
- 33:35hidden items field or you could make it
- 33:39specific like has hidden issues has
- 33:41hidden merch requests or something so if
- 33:43they have spammer request it doesn't
- 33:45affect the issues thing but um of course
- 33:48it comp uh you know you have to store
- 33:50more builds
- 33:53and I was also wondering because you
- 33:56mentioned this like we could even start
- 33:58right now with private groups right are
- 34:00private groups like you know susceptible
- 34:03to these like band us maybe they they
- 34:06don't actually need this CLA right
- 34:08likely not
- 34:09yeah well I guess
- 34:13so I one other thing but again this is
- 34:16again something that that probably abuse
- 34:18team should be concerned with is like
- 34:20what if someone overtakes someone else's
- 34:22account pay something you don't really
- 34:25want to delete all of his data right way
- 34:28you want to validate that that that user
- 34:30is really a bad actor and it's not
- 34:32something temporary and so on and so
- 34:34forth
- 34:36so just deletion itself is probably
- 34:38something they'll have to deal deal with
- 34:40and and not delete it right away but
- 34:42that's a different question and and
- 34:44similar with the with the private groups
- 34:46I guess um it's just like I I I would
- 34:49like us to focus on implementing this
- 34:52query where we know that a given Nam
- 34:55space has or doesn't have hidden items
- 34:59rather than implementing the whole
- 35:01infrastructure so to say right the whole
- 35:03framework of how do you mark the
- 35:05namespaces when the user is reported not
- 35:08reported detected and so on and so forth
- 35:10but maybe we have to do it just to not
- 35:12be blocked by another
- 35:15team I have sort of an alternative
- 35:18solution what if we ask the abuse team
- 35:21instead of this implicit hide in all
- 35:24issues
- 35:25workflow just add the like checkbox or
- 35:29maybe drop down like delete all issues
- 35:32in the Mrs in the last x amount of time
- 35:36so every time they bun
- 35:38someone uh they actually kind of add
- 35:41this uh checkbox so in that case
- 35:45Alexander what you said if that's a
- 35:47legit
- 35:48account and it has the normal history
- 35:52then we just delete whatever was done in
- 35:54the last day or
- 35:56two and uh the rest keeps we keep in the
- 36:00database and then we don't have to have
- 36:03this neither denormalization on every
- 36:06level or SQL query because there will be
- 36:10no data to
- 36:12filter but we the only con here is that
- 36:16we depend on the abuse team doing the
- 36:18right thing right like clicking it when
- 36:20they need to because if they miss it
- 36:22then the issues are left there visible
- 36:24correct yeah yes but uh I mean I assume
- 36:30they should be doing the right thing
- 36:32right if they want they will change
- 36:38it unless they have some automation
- 36:41right now to autoban when there are
- 36:42reports or something I don't know the
- 36:44you know workflow they have right now if
- 36:45they have something like that because
- 36:47there's the report abuse button right
- 36:49maybe they have an auto ban after X
- 36:51number of reports or something I don't
- 36:53know and you also need to hide the
- 36:55existing data um
- 36:58but I think our our question like how we
- 37:01move forward is depending on if we are
- 37:04allowed to delete this data or not and
- 37:06then if you're allow allot to lead the
- 37:08data the implementation will be based on
- 37:11the retention policy um who can make
- 37:15this decision if you delete band user
- 37:17data or like band user issues at
- 37:21least I can discuss it with product and
- 37:24pull in the uh anti-abuse Team
- 37:29I think we should definitely delete the
- 37:31data we should be coming from the
- 37:33position that we want to do it let's
- 37:35discuss how we can do it yeah can do
- 37:38well I think we can also run some stats
- 37:40from database to just see how much data
- 37:43we talking about as well in terms of
- 37:44issues and and whatnot right like there
- 37:47should be a count I don't think it's
- 37:49that much and I don't think the problem
- 37:52is really the data that we have but
- 37:55rather this join on this huge table as
- 37:58well so like deleting the data like
- 38:00having a policy on deleting the data
- 38:03perhaps helps us not join the table as
- 38:06well so that that's that's probably the
- 38:08the conclusion there I'll run the crew
- 38:10while we talk then we can see at the end
- 38:13of the talk yeah I think for gitlab or
- 38:15gitlab there were there we have like
- 38:1775,000 open issues and like I think when
- 38:20I cre like 68,000 are like not banned
- 38:24not hidden so I think there's like
- 38:26around 7,000 I don't know I'm not 100%
- 38:28sure in the numbers but if I remember
- 38:30correctly those were
- 38:32the because yeah our project is subject
- 38:35to a lot of like abuse right
- 38:38before a random idea what if we create
- 38:42maybe another table with a Json B column
- 38:46and move this data to this other
- 38:49table then maybe it's partitioned by
- 38:53date or something and we can just drop
- 38:55these the the this archive
- 39:01automatically which uh data they issues
- 39:04from the band users yeah so instead of
- 39:07why would why why would we want to
- 39:09retain them because we not sure that in
- 39:13the time before we validate that that's
- 39:17actually yeah okay basically when you
- 39:20unban you copy it back right yep
- 39:25exactly only where we is that we then
- 39:28need to deal with all the foring keys
- 39:30right
- 39:34um like the other implications
- 39:36implications of all the associations
- 39:38with that table that's
- 39:45true I mean it couldn't be it could also
- 39:48be like a real table not a Json B column
- 39:51like the real copy of issues table same
- 39:53columns and all that like same foreign
- 39:55key constraints so that they also
- 39:56Cascade delete to those tables but
- 40:00yeah well it's a duplicate database now
- 40:03that you need the forign keys to the
- 40:04tables that point to a different table
- 40:08now right like the the signes are now
- 40:11need to point to a different issues
- 40:14table I mean there's the other way how
- 40:16we could do this is like instead of the
- 40:18issues table we make a materialized view
- 40:21out of it that this doesn't include the
- 40:23band
- 40:24users but I don't want the go r
- 40:33cool any more ideas on the band
- 40:36users
- 40:41discussion all right I'll move to the
- 40:43next couple sync items so prissa she'll
- 40:47be starting working on the proof of
- 40:48concept for elastic search uh then there
- 40:52r no update so far and also if she'll be
- 40:57and the uh DB maintainer I mean she's
- 41:01just started
- 41:02the how to call train training
- 41:05maintainer isue um so if you have the
- 41:09database related qu uh Mr uh send it her
- 41:14way uh yeah it will give her experience
- 41:17and also the understanding of what we
- 41:19are working
- 41:21on and Dimitri you have a next Point
- 41:25sure so just want to have this design
- 41:28document tomorrow so I'm proposing to
- 41:30completely change how we handle finders
- 41:33so that we can use several back ends
- 41:35including pogress elastic search and I
- 41:38think even if you don't have advanced
- 41:40search enabled it should still help
- 41:42because in this design document I
- 41:44proposed to support offset limit pation
- 41:47as well as key set and scroll API
- 41:49pagination so I think just key set
- 41:52regation might make it more efficient
- 41:55for finders but but the main goal is to
- 41:58support several backends at the same
- 42:00time and maybe we can transparently
- 42:03migrate by adding support to several
- 42:07media options or parameters and I hope
- 42:11that we can try something similar with
- 42:14Alisa so with for this proof of concept
- 42:17work we might be able to introduce a
- 42:20finder that looks kind of similar to
- 42:22what I'm
- 42:24proposing and the main problem with ex
- 42:27finders that they return active record
- 42:30Scopes and if we use advanced search we
- 42:33cannot post filter the data so I'm
- 42:36proposing to do all filtering in the
- 42:38finder itself so that completely changes
- 42:41how we handle finders across gitlab but
- 42:44I think it can open a lot of really good
- 42:47possibilities to optimize many different
- 42:50use cases not only work items
- 43:03any
- 43:05thoughts yeah I was just thinking there
- 43:07are like some use cases where we chain
- 43:09some finders into some other you know as
- 43:11a subquery into this some other thing or
- 43:14like add a CL so those don't work
- 43:16anymore right so
- 43:20yeah so we kind of need to get a Buy in
- 43:24from from the engineering but I hope we
- 43:27we can achieve that because the benefits
- 43:29I think outweigh this one thing that we
- 43:33return
- 43:36Scopes and I hope we can introduce page
- 43:39token so it will be consistent
- 43:41pagination approach independent on the
- 43:45back of of the back end you're using so
- 43:47it will be just one parameter to get
- 43:50next page maybe even previous page for
- 43:53key set
- 43:54pagination so we might be able to stop
- 43:57using offset based imination completely
- 44:00because I think that's really in
- 44:01efficient when you go deeper maybe I
- 44:05don't know 20th page or
- 44:10something yeah I'd also like to add like
- 44:12this was also discussed during the tech
- 44:15Summit thing related to data retention
- 44:19because uh finders with multiple
- 44:21backends was like was one solution to
- 44:25like you know storing some data add to
- 44:28the object storage which is much cheaper
- 44:30than the database if you want like a
- 44:31cold storage for like very old data so
- 44:35could be extended to do that in the
- 44:40future Henrik is there any work
- 44:42happening around
- 44:44that no I don't think so it's more of
- 44:48like a just a
- 44:49discussion okay do you know who was kind
- 44:51of suggesting this whole
- 44:54thing um I don't know I think
- 44:57sh car was involved
- 45:02and the data attention te faio I
- 45:08think I I think generally it's a great
- 45:12idea to have this finders that that can
- 45:16have multiple
- 45:18backends the problem
- 45:21is at least
- 45:23from plan stage so to say I don't know
- 45:26how much capacity we have to work on
- 45:28that I think we have already a lot of
- 45:31technical de between
- 45:35um issues code base and work item code
- 45:39base if we start adding this that is
- 45:42going to be very very hard to to go for
- 45:45like to improve even further and and so
- 45:48on um like I'd love this to be something
- 45:51that we do I just don't know how and I
- 45:55think like plan is probably one of the
- 45:58the bigger um benefit benefiters of of
- 46:02this thing as well is just like I don't
- 46:04think we have capacity to really take it
- 46:08on and and do it but I don't know maybe
- 46:10someone thinks
- 46:12otherwise I think even one step in that
- 46:15direction is using this as a wrapper so
- 46:18we still have the Legacy finder under
- 46:21the hood but we restrict that it's no
- 46:23longer an active record scope that we
- 46:26were return I think even that can help
- 46:29because we can then incrementally add
- 46:31advanced search support on top of that
- 46:34maybe some only some subset of the
- 46:37parameters will use advanced search but
- 46:40it will allow us to go in that direction
- 46:43right now it's not really possible so
- 46:46I'm hope that we can enforce this that
- 46:49we no longer return scopes with these
- 46:52Advanced finders and if we just Advanced
- 46:54finders everywhere that's where really
- 46:58yeah no I I think it's it's like I said
- 47:00it's a good idea I think that is worth
- 47:03pursuing it's just like and and Vlad is
- 47:06here he's participating in a lot of this
- 47:07meeting I think like for
- 47:09next like up until quarter three we are
- 47:12so packed I don't think we can take on
- 47:15any of this stuff and afterwards I don't
- 47:18know if that that means that after
- 47:19quarter three we can actually now pull
- 47:21in some of some of this stuff as well
- 47:23it's just like right now at least that's
- 47:26my feeling as an as an engineering plan
- 47:28stage is like we don't have a lot of
- 47:30breathing room even this work group is
- 47:33kind of
- 47:34already done just so that it can support
- 47:37some of the this tiered items um but
- 47:41yeah I I don't
- 47:43know like I would love to to see this
- 47:45done it's just I don't know how much
- 47:47time we can allocate to to really do it
- 47:51I think if there's a benefit to do this
- 47:54then we should do it like there's no
- 47:56question if it should be done if it's
- 47:59beneficial to us and improves us there
- 48:02we have like a 6040 ratio of what we
- 48:04should do there are technical road maps
- 48:07as Sabrina also said engineering should
- 48:10push for this stuff so yes so we we we
- 48:14should do just do even this working
- 48:15group is a good example this was never
- 48:18accounted for anywhere we just do it
- 48:20because actually we need it and we have
- 48:23many of these
- 48:25things and I think could also find a way
- 48:28to like you know make the scope a bit
- 48:31smaller like we don't have to like not
- 48:33return active record relation everywhere
- 48:35right we could start with like the group
- 48:38uh. workor items field in graphql that
- 48:40uses an advaned finder the project.
- 48:43workor items field also uses Advanced
- 48:45finder everywhere else use the Legacy
- 48:47finder for now right and just focus on
- 48:50that single use case of searching um
- 48:53listing items under a project or group
- 48:56so
- 49:08okay okay uh yeah I kind of agree to be
- 49:13honest with Alexandre in general that we
- 49:16are very much over capacity as a whole
- 49:20of plan and it will be kind of hard to
- 49:23schedule but a lot of our technical that
- 49:27is around this performance and uh
- 49:31reliability issues
- 49:32so yeah maybe we can use it as a
- 49:35step uh towards resolving this uh as
- 49:40well and I kind of like What
- 49:44U HRI just proposed uh yeah maybe we can
- 49:48start now with this elastic search
- 49:50proposal that Alisa is working Alisa is
- 49:52working on and then uh St
- 49:57introducing this
- 49:59rappers here and there um so yeah yeah
- 50:04what one thing I want to add is like
- 50:07again I'm not it may feel like I'm
- 50:09against it or
- 50:10pushing uh pushing it off sort of thing
- 50:13it's like I don't want to end up with
- 50:16yet another back end among all other
- 50:19ones that we have like I understand the
- 50:21idea of gradually introducing it like in
- 50:23Su end points and and using it and
- 50:26that's probably what is going to happen
- 50:27anyway it's just like like Dimitri also
- 50:30said we need the buying of of all
- 50:32engineering because if we want to do it
- 50:34we need to put in some rocop rules in
- 50:37place some stuff in place where we
- 50:39actually don't have like don't have it
- 50:42being used in just in some places so
- 50:44then we have it again like this kind of
- 50:46technical dep where someone is using
- 50:48this finder someone else is using this
- 50:50other finders so it's all like a even
- 50:52bigger mess as as we introduce new stuff
- 50:56um but yeah like we we can we can see
- 50:59what we can do to start introducing it
- 51:01but we probably need a bigger buying as
- 51:04well um I I think from plan stage we are
- 51:08all on board in doing that just don't
- 51:10know about capacity and not how we can
- 51:12start uh and yeah we should be very
- 51:15careful about introducing yet another
- 51:17back end to to do stuff and and make
- 51:20things even more complex and complicated
- 51:22to
- 51:23maintain I think that that might be a
- 51:26good opportunity to collaborate between
- 51:28Global search and plan because that's
- 51:30kind of our goal as well even though
- 51:33that work items and merge request lists
- 51:37aren't our feature but we've been
- 51:39receiving a ton of feedback that it
- 51:41doesn't work properly time out and every
- 51:44time we had to say that this is not our
- 51:47feature but this is really confusing to
- 51:50team members and customers so we really
- 51:53want to solve this problem
- 51:56is there any way how we could evaluate
- 51:58the performance difference for example
- 52:00from Two cves and see like where it's
- 52:03the where it makes the most sense to use
- 52:06the elastic search back
- 52:07end I think you can maybe perform some
- 52:12searches right now on gitlab.com maybe
- 52:15select gitlab org so group level search
- 52:18and gitlab or gitlab as project and
- 52:22compare the performance maybe in the
- 52:24performance bar I think that could be a
- 52:26good comparison because I think most of
- 52:29the time or really frequently it times
- 52:32out in the issue list and merge quest
- 52:35list but it's maybe several hundred
- 52:38milliseconds on the advancer side so the
- 52:41performance different difference is
- 52:43insane so it could be a massive
- 52:47Improvement yeah that that's probably
- 52:49where that JM Nicholas that you kept
- 52:52advertising where you can run the the
- 52:54two code paths at the same time would be
- 52:57very useful in comparing that right I I
- 52:59don't remember how it's called though
- 53:01but scientist uh yeah scientist uh so
- 53:04then you can yeah with with this
- 53:09abstract
- 53:10basically uh finder you can you can run
- 53:13both at the same time compare and and
- 53:16gather some statistics and then default
- 53:18to just
- 53:24one cool yeah I think let's
- 53:27see what the outcome of this first
- 53:28elastic search PC will be and it will
- 53:32take us a couple weeks uh we kind of
- 53:36over time so I wanted to quickly run
- 53:38over the action item so we decided to
- 53:40postpone this discussion on
- 53:43the uh using the three
- 53:47optimization and we'll need to bring it
- 53:49up with u product and abuse team about
- 53:53the BN
- 53:55users any Miss I forgot no not not let
- 53:59you forgot but uh while we were talking
- 54:02here I checked again the city queries
- 54:04that were doing any and I thought the CT
- 54:08you were doing was by joining the issues
- 54:10and the band users but uh actually were
- 54:13join the issues and the work items and I
- 54:16tried the another approach of the city
- 54:18joining the issues and the uh band users
- 54:21and it seems to bring a little bit of uh
- 54:23Improvement in there so I just want to
- 54:25share that I triy that and maybe you can
- 54:28introduce use that somehow in your
- 54:30efforts in
- 54:39there so just to can you reiterate like
- 54:43uh you found a new approach with the
- 54:46CTE uh who do you want to look into it
- 54:50Alexandra or
- 54:56you
- 55:00muted uh sorry sorry
- 55:04uh I no I just want to share that I did
- 55:07that I tried another approach of the
- 55:10city with enrik um because he was doing
- 55:13this work and maybe this new city that I
- 55:16tried with the indexes that you were
- 55:19planning to introduce with work items
- 55:21types can be a better Improvement than
- 55:24just the CT with the band users not not
- 55:27sure yeah just trying new stuff here
- 55:29yeah I'm I'll look into it but yeah I
- 55:32think my initial findings was like if I
- 55:35remove either one of these uh filters
- 55:37the work item type or band user then
- 55:39it's fast um so so I'm just trying to
- 55:43find a way to eliminate one filter by
- 55:45you know adding it to an index or
- 55:47something like work ATM type it's easier
- 55:49to add to an index because the column is
- 55:51in
- 55:52the um you know on the table right so
- 55:55yeah yeah that's my point actually like
- 55:57maybe you add the the index and use the
- 56:00CT with the band users and maybe the two
- 56:02things together combined can be a better
- 56:05Improvement
- 56:09yeah cool uh quick poll uh how do you
- 56:14guys so find the discussions like is it
- 56:18valuable is it to long
- 56:20[Music]
- 56:22or right amount right white time for
- 56:27me I think it's valuable I don't know as
- 56:30we move forward like I think next week
- 56:32is still fine uh but I I kind of find it
- 56:36hard to find time to work a lot on this
- 56:39stuff um I think I'll I'll be fine this
- 56:44week I don't know about the next one um
- 56:47like I keep getting a lot of reviews and
- 56:49I keep like I I keep postponing the
- 56:51stuff that I really need to work on well
- 56:53really this is really need to work as as
- 56:55well but like some of my uh uh items
- 56:59that I need to work on so for me I think
- 57:02it's still fine for the next week I I
- 57:04can re-evaluate for after that as well
- 57:07and and let you
- 57:12know by the way I think about this
- 57:15Advanced uh finders we can add it as a
- 57:18postponed item as well I don't know when
- 57:20to postpone but just like for you Vlad
- 57:22to to put it there somewhere on a on a
- 57:24shelf and bring it up in like couple
- 57:27weeks well potentially after the the
- 57:29elastic search thing as
- 57:34well okay I'll do that yeah my concern
- 57:37here is that uh we spend an hour of a
- 57:41lot of talented Engineers so if at any
- 57:44time you guys feel like
- 57:47uh maybe we should discuss something the
- 57:49in or anything uh let me
- 57:52know otherwise uh thank you all I think
- 57:55it's a super great discussions and uh
- 57:59yeah let's focus on these couple
- 58:01follow-ups and see what we can get of
- 58:04them yeah enjoy the rest of your day see
- 58:07you
About this transcript
This page contains the full transcript of Work Items API performance WG - 2025-03-18 by GitLab Unfiltered, generated from the public captions YouTube serves with the video. The transcript has 8,740 words across 1,225 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.