YouTube2Text

Work Items API performance WG - 2025-03-11 — Transcript

by GitLab Unfiltered · 8,972 words · 1,278 segments · language en · Watch on YouTube

Full transcript

  1. 0:02Hey everyone, this is uh work items API
  2. 0:05performance working group. Today's t uh
  3. 0:0811th of March and
  4. 0:11uh yeah um let's maybe start with
  5. 0:15quickly
  6. 0:16uh recapping what happened uh over the
  7. 0:20week and kind of what we discovered
  8. 0:24since that kind of was the main thing uh
  9. 0:28from the last
  10. 0:34meeting. and feel free to just move
  11. 0:36items from the bottom. Like Alexander, I
  12. 0:38think yours fit in well. Yeah. So, uh
  13. 0:43I'll I'll verbalize and then I'll I'll
  14. 0:45add an issue with a little bit more
  15. 0:46detail here. But just to give you some
  16. 0:50understanding like I took last time an
  17. 0:51action item to see if there is any um if
  18. 0:55we shave off some of the permission
  19. 0:56checks, how does that influence the
  20. 0:59query times in general? because like uh
  21. 1:02we do some of the permission filtering
  22. 1:05in the finders anyway and then we do
  23. 1:08that in the GraphQL as well. So that
  24. 1:10that feels kind of duplicative. Um so
  25. 1:13I've gave there some context. Um I I
  26. 1:16just increase the number of items
  27. 1:18returned locally. I don't have a big
  28. 1:20database locally by any means but just
  29. 1:22to exacerbate any kind of gains that I
  30. 1:24can see from that is like I want to
  31. 1:26return as many items I can I can fit. Um
  32. 1:29so basically increase that to 400 items
  33. 1:31versus I think we have 100 today in on
  34. 1:34production.
  35. 1:36Um so for that my query locally is
  36. 1:40running 11 seconds like the the the
  37. 1:42query in the in the networking is
  38. 1:44showing 11 seconds right uh which is
  39. 1:46crazy. Uh the database uh in in progress
  40. 1:49bar is like under 100 milliseconds 60
  41. 1:52milliseconds like 50 milliseconds. So
  42. 1:54all the time is spent in in GraphQL
  43. 1:57middleware or like CPU garbage
  44. 1:59collection all that stuff right. Um so
  45. 2:03in terms of uh skipping the uh the u
  46. 2:05permissions we have that that helper
  47. 2:07there skip type authorization where
  48. 2:10because you load the items and then each
  49. 2:12type checks basically every object
  50. 2:14instance the uh type again that was
  51. 2:16shaving off around 10 to 15% like one to
  52. 2:20one and a half second off of that um 11
  53. 2:23seconds. So there is some gain but like
  54. 2:26not exceedingly much. And then the next
  55. 2:28radical thing I was like okay what if I
  56. 2:30remove um widgets altogether like I will
  57. 2:34only load whatever the base types are
  58. 2:37there on on the on the collection and
  59. 2:39that reduced it to like around 50%.
  60. 2:42Right? So um a lot of the time is spent
  61. 2:44within the widgets themselves. Like the
  62. 2:47next thing was like what if I lo just
  63. 2:49the empty widgets and and not like all
  64. 2:52of the data just the basically the
  65. 2:55interface right uh so all I left is the
  66. 2:58underscore type which is the the
  67. 3:00graphql's way of of saying this is the
  68. 3:02type of the object. Um and that was not
  69. 3:07reducing like the same 50%. And I was
  70. 3:09expecting that like there should be
  71. 3:10close to no overhead where instead it
  72. 3:13was like more of like it was around 8 to
  73. 3:179 seconds returning like pretty
  74. 3:20constantly. So that kind of tells us
  75. 3:23that there is a lot of overhead coming
  76. 3:24from the GraphQL itself or I don't know
  77. 3:27if we have some objects that we
  78. 3:29initialize within the GraphQL or that's
  79. 3:31that's just the gem how it works like we
  80. 3:34need more
  81. 3:35um to dive deeper into that or just I
  82. 3:39don't know maybe maybe there's a case to
  83. 3:41be made to move off GraphQL for for that
  84. 3:45um completely. I like I I don't have a a
  85. 3:47good answer. It's just like what I've
  86. 3:49what I found so
  87. 3:51far. And I'll again I'll I'll add some
  88. 3:54of the uh flame graphs and whatnot what
  89. 3:56I have uh into a more detailed issue. I
  90. 3:59just didn't have the time to to do so
  91. 4:00yet. I'll formalize it in in a bit
  92. 4:03better way.
  93. 4:09Um should I move to mine?
  94. 4:12And yeah, if you if you don't have any
  95. 4:14questions or like maybe some
  96. 4:16clarifications, then we we can move on
  97. 4:17to the next one. Yeah.
  98. 4:21Um, so on my side, I
  99. 4:24um so I I added some information about
  100. 4:27removing widgets from the main query of
  101. 4:30listing work items. So um in that case
  102. 4:35it confirms that uh linked items is one
  103. 4:39affecting the query the most. Uh second
  104. 4:42it would be labels but mainly in the
  105. 4:45group query uh when we include uh
  106. 4:49projects I tested that locally and that
  107. 4:51was the biggest difference in in the
  108. 4:54information you can see there we go from
  109. 4:56timing out in the group query to
  110. 4:59actually returning. Um so and there's
  111. 5:05another one I added this point later so
  112. 5:07maybe I can extend that later. Um and
  113. 5:11then we discussed the children list as
  114. 5:13well. That that was quite slow when we
  115. 5:16included um widgets in the hierarchy
  116. 5:21widget. But um so in that case I confirm
  117. 5:25again that the slowest queries were for
  118. 5:29roll up. Um so we have weight, health
  119. 5:33status and the count of children. Um the
  120. 5:37question about this is if we want to
  121. 5:40include in the scope of this group
  122. 5:43working on other queries that's not the
  123. 5:45main query because I was a little bit
  124. 5:47confused about that. I saw some comment
  125. 5:49that said that if if it's not if it's
  126. 5:53for example single single work items
  127. 5:55having performance issues that's
  128. 5:57something we're not going to deal in
  129. 5:59this uh group. So, h I'm not sure if you
  130. 6:03want to include this uh or or do more
  131. 6:07research about it.
  132. 6:11That's a good question. Uh from what I
  133. 6:15gather right now, the most blocking uh
  134. 6:19problems for us are the lists, right? Uh
  135. 6:24kind of blocking all these like tier
  136. 6:26deliverables for assets, JLK, but
  137. 6:29whatever. And
  138. 6:31uh
  139. 6:35how if we looking into the single item
  140. 6:40uh is there
  141. 6:42any like what what is the benefit of
  142. 6:46looking at it right now like optimizing
  143. 6:48making it better obviously but uh uh
  144. 6:52yes pushing us in in
  145. 6:55in a specific case of children we've
  146. 6:59been looking at it from the
  147. 7:02um error budgets. This is affecting the
  148. 7:05error budgets. So we already had some
  149. 7:08focus on it and we were trying to
  150. 7:10improve a lot of it is is is very
  151. 7:13unperformant like moving the children.
  152. 7:16Uh so I think like even if we don't pay
  153. 7:19attention to it during this group it
  154. 7:21will still be handed for other reasons.
  155. 7:24uh it would be mostly if uh if this was
  156. 7:27affecting using um other features that's
  157. 7:31not listing uh this might even uh be a
  158. 7:35problem when we deal with boards but
  159. 7:38that's not yet so I think it would be
  160. 7:41okay to leave it out and focus on
  161. 7:43listing work items
  162. 7:45um I'm not aware of any place where we
  163. 7:49list work items now and we include the
  164. 7:51hierarchy widget it
  165. 7:55I think it will be fine to include it
  166. 7:57but as a kind of lower priority goal
  167. 8:00that like mostly we are focusing right
  168. 8:02now on the
  169. 8:04uh listing of items but uh we can also
  170. 8:08discuss and like it may also be related
  171. 8:11right to some of the other work that we
  172. 8:12do anyway so
  173. 8:16just wanted to clarify so the children
  174. 8:19thing like the rollups they're mainly
  175. 8:21for the hierarchy key list, right? Like
  176. 8:23the widget and not for the listing page
  177. 8:25or do we have plans to show it there or
  178. 8:28like um I I think um um I'm not sure
  179. 8:34what we used to include. Uh I know that
  180. 8:37in boards we will include the number of
  181. 8:39children of each epic. So we used to use
  182. 8:42the count. I think we also include the
  183. 8:45progress. So the the weight uh roll up
  184. 8:50but in the
  185. 8:51listing no what I remember is that we
  186. 8:54used to have the blocking and blocked
  187. 8:56items. So the linked uh widget even if
  188. 8:59we remove it now we probably have to add
  189. 9:01it later. Um but yeah for roll apps I I
  190. 9:05don't I don't think there's any use for
  191. 9:07it but maybe someone from front end
  192. 9:09would know better. I I don't remember
  193. 9:11how the parity of the other lists look.
  194. 9:18Yeah, I just remembered that we added
  195. 9:20that for the hierarchy. So, I was just
  196. 9:21wondering. But I think one of the good
  197. 9:23things about this uh children thing
  198. 9:25though is like we have a way forward
  199. 9:27like we have the epic for like caching
  200. 9:29this in the DB and like uh yeah, it's
  201. 9:32just um it's just it just takes a lot of
  202. 9:35work. So it's not probably not like a
  203. 9:38working group thing because working
  204. 9:39group for me I think is more of like
  205. 9:41exploring the solution and this is more
  206. 9:42of like implementing the thing and it's
  207. 9:44more like planning who would do it right
  208. 9:48or something allocating like engineer
  209. 9:50ours for that but
  210. 9:53yeah I'm not sure if if we are going to
  211. 9:56touch anything about mutations
  212. 9:58performance we haven't discussed that at
  213. 10:00all but that is also another problems in
  214. 10:04children the the update mutation for
  215. 10:07work item can be very slow when you are
  216. 10:12uh depending on the widget. But yeah,
  217. 10:15that that might be just outside the
  218. 10:17scope as well.
  219. 10:32Uh Henrik, do you want to verbalize the
  220. 10:35next point? Yeah. So I just did some
  221. 10:38experiments on our the main query that
  222. 10:40we do
  223. 10:42like I actually just didn't um here I
  224. 10:45could share my screen
  225. 10:53maybe. Yeah. Yeah. So this is like I
  226. 10:55started with a project level query and
  227. 10:57this is
  228. 10:57uh how our query looks like right now.
  229. 11:00We filter by work item types because we
  230. 11:05um this is the query that Nicholas was
  231. 11:08measuring, right? This is the same query
  232. 11:09the graphql query makes. And the main
  233. 11:12filter here is like this one
  234. 11:16the set of types that we want to show on
  235. 11:19the issue list today. We exclude
  236. 11:22requirements and epics and test cases I
  237. 11:26think or something. But um and the other
  238. 11:28one the band users one was what like u
  239. 11:30Nicholas also mentioned the last time.
  240. 11:34So we look at
  241. 11:36the plan
  242. 11:39um it's not the slowest but it's also
  243. 11:41not the fastest.
  244. 11:44uh we could see that it
  245. 11:46uh queries by record type, project ID,
  246. 11:50state and but the main problem here is
  247. 11:52that it fetches all 75,000 open issues
  248. 11:56of this project and this takes most of
  249. 11:59the
  250. 12:00time. After getting the 75,000, it pairs
  251. 12:04it with the band users. You know, this
  252. 12:07is a 75,000 loop just to check each one
  253. 12:09if they're part of the band users. and
  254. 12:11then it sorts the 75,000. So it could
  255. 12:14get the first 100 created at. So that's
  256. 12:18where
  257. 12:19the that's the sort of problem we deal
  258. 12:21with with a group level query. So it's
  259. 12:24similar. So it's like the main issue
  260. 12:26here is like fetching everything. So I
  261. 12:28did some tests here.
  262. 12:31Um first I tried removing the work item
  263. 12:33type filter and I was surprised that uh
  264. 12:36this actually much faster. The buffers
  265. 12:38were much smaller. What happened here
  266. 12:41was
  267. 12:42that it scanned this index with a sorted
  268. 12:45list already. So it didn't have to fetch
  269. 12:48all
  270. 12:4875,000.
  271. 12:49[Music]
  272. 12:54Um fetched it in parallel and then still
  273. 12:57the same thing matched it with the band
  274. 12:59users but since Postgress is working
  275. 13:02with a sorted list already I think he's
  276. 13:04just getting the first you know here
  277. 13:07it's like 3 * 47. is like 130 something
  278. 13:11until it gets 100 uh that it needs.
  279. 13:14That's why it's much
  280. 13:16faster. Removing the band user filter is
  281. 13:19what uh Nicholas mentioned before like
  282. 13:23um also mentioned uh similar thing
  283. 13:27happens here. So an index makes you
  284. 13:30fetch the 100 instead of the 75,000 and
  285. 13:33it's much faster. So that kind of like
  286. 13:37frames the problem right the main
  287. 13:39problem here is like fetching we have to
  288. 13:41frame the query in a way where we don't
  289. 13:43fetch all the items uh from the DV and
  290. 13:47here's another experiment also because I
  291. 13:49noticed that we were filtering
  292. 13:52by this uh base type thing right joining
  293. 13:55to work item types and uh base type in
  294. 13:59this array we don't actually need to do
  295. 14:01this because
  296. 14:05um we know the fixed ids of each type.
  297. 14:09Uh we could just do issues.work item
  298. 14:12type ID is equal to you know these ids.
  299. 14:15It could be a subquery. In this case I
  300. 14:17just put in all the uh ids and Mario
  301. 14:21also worked on like this now fixed one
  302. 14:24to nine today. So it's kind of like
  303. 14:26easier. Um, in this case it still
  304. 14:30fetches all
  305. 14:32um 75,000 or in this case I think 67 I
  306. 14:35don't know it's like fetching and then
  307. 14:38pairing with a band right away or
  308. 14:40something but then it does it in
  309. 14:42parallel and based on some tests it's
  310. 14:46like the execution time
  311. 14:48is a
  312. 14:52um I wouldn't say like significantly
  313. 14:55faster than the original query. So I'm
  314. 14:57still exploring this you know if it's
  315. 14:58this is worth doing and how um I'm
  316. 15:01testing this with queries with like uh
  317. 15:03you know label filters and all that and
  318. 15:05maybe I haven't gone through the group
  319. 15:07level. So that's one area I'm looking to
  320. 15:11explore in other parts of it. Yeah.
  321. 15:14Yeah. Just one one uh question. This
  322. 15:16looks like a simplified query of oh this
  323. 15:19is the project level on one specific
  324. 15:21project only right.
  325. 15:29What? Yeah, you were cutting out. What
  326. 15:31was that? Yeah, I'm not sure what's
  327. 15:33going on because I should be having the
  328. 15:35good internet. Um, so that was the query
  329. 15:39for just one one project.
  330. 15:43Uh, that's not even like that's not
  331. 15:45coming for that's not even the issues
  332. 15:48query on the group level, right? where
  333. 15:50we filter where we only query project
  334. 15:53level work items. Yeah, this is the
  335. 15:55project level query for now. And yeah, I
  336. 15:57forgot to mention uh one one reason the
  337. 16:00project level is much simpler than the
  338. 16:02group level is that we do the provisions
  339. 16:05check for project level queries outside
  340. 16:07of this query, right? Because there's
  341. 16:08only one project, you just do like can
  342. 16:10read issue like project and once you can
  343. 16:13read it, then this is the query. for a
  344. 16:15group level it's like query all the
  345. 16:18projects with under this group or all
  346. 16:21the name spaces under this group plus
  347. 16:23with the clauses there for the
  348. 16:25permissions check and all that so um
  349. 16:28yeah so I'm starting with this and
  350. 16:30seeing like how it works with other
  351. 16:33queries too like the other variants like
  352. 16:35the group level
  353. 16:37um but like I said like the DB part
  354. 16:41right now with the project level isn't
  355. 16:43um the biggest chunk like the I
  356. 16:46mentioned this in another point like uh
  357. 16:48the lowest hanging fruits. There are
  358. 16:50bigger gains to be had with the N plus
  359. 16:52ones and all that.
  360. 16:55So I'm not sure if it's worth like
  361. 16:58pursuing really these like tiny gains
  362. 17:00here, but yeah, this is just something
  363. 17:02interesting I looked into this week.
  364. 17:05Yeah. Yeah, that that makes sense. Like
  365. 17:06I wonder if if there are more gains when
  366. 17:09we go into group level uh queries where
  367. 17:13where we can do more like we can
  368. 17:16optimize more of that
  369. 17:20stuff. But yeah that that's interesting.
  370. 17:24I I also feel like we we should be able
  371. 17:27to remove those uh type filters when we
  372. 17:31because we are talking about the unified
  373. 17:33work item list right. So at that point
  374. 17:35like we should be showing everything and
  375. 17:38then when we want to render specific
  376. 17:41stuff that's when we want like we can
  377. 17:43decide is it a work item or is it a
  378. 17:44legacy um visualization of that if it's
  379. 17:48a test case or I don't know what but but
  380. 17:50we can still I think put it all under
  381. 17:53one query but then you'll have filters
  382. 17:56by type anyway so we'll have to deal
  383. 17:58with that. Yeah, users could filter by
  384. 18:00type anyway, right? Definitely. But
  385. 18:02that's also that's also a very good
  386. 18:03point. That's one of my questions also,
  387. 18:05right? Like regarding our goal right
  388. 18:08now,
  389. 18:09um what's the
  390. 18:12query? It's the same question. What the
  391. 18:14what's the query we want to optimize,
  392. 18:16right? Is it the future query where we
  393. 18:18have an consolidated list or the query
  394. 18:21we do now with these like restrictions,
  395. 18:23right?
  396. 18:26um like work item list with epics only
  397. 18:29to replace the epics list. There's this
  398. 18:32uh issue list today that's filtered by
  399. 18:35certain types so that it matches the old
  400. 18:36behavior or do we optimize for the you
  401. 18:39know future consolidated list for
  402. 18:42everything?
  403. 18:49I I have the impression that there's
  404. 18:51some types that they're always going to
  405. 18:52be filtered out like requirements
  406. 18:54because they live in a different um
  407. 18:58menu. So I think the consolidated list
  408. 19:00is more for issuables or well in this
  409. 19:03case uh tasks, issues, epics, but I'm
  410. 19:06not sure if they will include um even
  411. 19:09maybe objectives that would have a
  412. 19:11different
  413. 19:12menu. So we might have to keep filtering
  414. 19:15this out.
  415. 19:17Yeah, it depends on the product goals,
  416. 19:19right? Because if we see that the long
  417. 19:21term these types are always going to be
  418. 19:24like out of the main list of types, then
  419. 19:28a an index with targeting those specific
  420. 19:31types uh sorted by graded at you know
  421. 19:33just for the default view would help.
  422. 19:37But yeah should be like
  423. 19:39a if we know the certain types you want
  424. 19:42to list and how you know how far in the
  425. 19:44future we want to like integrate
  426. 19:46requirements here or ne would it be
  427. 19:48never or you know what's the answer to
  428. 19:50that
  429. 19:52question I think uh yeah we really need
  430. 19:55both like right now we need to address
  431. 19:57the problem with current UI and with
  432. 20:00just migrating to the work items API so
  433. 20:04maybe what you suggested was just
  434. 20:06creating specific indexes for current
  435. 20:08queries will work and maybe we can have
  436. 20:11them in parallel uh kind of indexes for
  437. 20:14new queries and uh the current ones at
  438. 20:17the moment kind of my hunch is I want to
  439. 20:20focus on what we have now and what's
  440. 20:23blocking for the closest road map items
  441. 20:26like uh epics lists on u projects and
  442. 20:32issues lists on groups etc but I may be
  443. 20:37Yeah, another question is probably and
  444. 20:40that will kind of transition us to the
  445. 20:42yes thing is is there or can we find
  446. 20:47some BS and say if you have more than
  447. 20:49let's say 10,000 work items in general
  448. 20:53then you're better served off by quering
  449. 20:56it through advanced search which is
  450. 20:58elastic search. So then you need to do a
  451. 21:00little bit more um infrastructure
  452. 21:03maintenance and move on to that right.
  453. 21:04So cuz like this queries may be serving
  454. 21:08just fine with all the filters if you
  455. 21:10have a limited number of work items and
  456. 21:12then we can do that in PG and all
  457. 21:14whatnot. But then if you are over this
  458. 21:16limit, you'll you'll see the sufferings
  459. 21:18with the performance. You'll see all of
  460. 21:20these issues and then you're better
  461. 21:22served if you'll go and install and
  462. 21:24index your stuff in elastic search. And
  463. 21:26then that's where we can move on to the
  464. 21:28to the separate code path where we
  465. 21:30support the bigger stuff and searching
  466. 21:33um with all these types of filters and
  467. 21:35whatnot in in elastic search. uh that
  468. 21:38that makes the assumption that elastic
  469. 21:41search just uh magically solves it all
  470. 21:43for us like in a very performant way.
  471. 21:45But that's that's yet to be
  472. 21:47um validated so to say. But that's
  473. 21:51that's where I think we can transition
  474. 21:53to to the to this elastic search unless
  475. 21:56we have anything else on on the on the
  476. 21:58queries. I actually wanted to just ask
  477. 22:02what's your hunch like after all doing
  478. 22:04this all this exploration with uh uh
  479. 22:08databases and
  480. 22:09graphql what I see what you Alexandra
  481. 22:12just said is that most of the problem is
  482. 22:15coming from the graphql and widgets what
  483. 22:18is you can see in the Nicholas's
  484. 22:21uh charts is that yeah like database is
  485. 22:25also like 40% of the time uh in
  486. 22:28production
  487. 22:29Um so my question
  488. 22:31is is the current API the old issues API
  489. 22:36and epics are affected to the same
  490. 22:39degree or once we switch to the work
  491. 22:42items API everything suddenly becomes
  492. 22:45twice as slow as the current
  493. 22:50yeah the the
  494. 22:51uh I think I didn't look specifically at
  495. 22:55the work items API I know that we have
  496. 22:57this issue we had this issue with the uh
  497. 23:00nodes API where in REST it was much much
  498. 23:03much faster than through GraphQL. So I
  499. 23:07would assume we'll we'll see the same
  500. 23:09problem uh with the work items where
  501. 23:11like if you're doing it through rest
  502. 23:13it's faster but again the assumption at
  503. 23:16the time was that in rest you do
  504. 23:19basically or most of the permissions and
  505. 23:22all that checks um once and then you
  506. 23:25just present all of the data that you've
  507. 23:27validated as being accessible. uh
  508. 23:30whereas in GraphQL you do it a lot of
  509. 23:32times through all of these types that
  510. 23:34you render in in the tree kind of
  511. 23:36structure, right? As you go deeper into
  512. 23:38a node, you you kind of check it again
  513. 23:40and again. Um that was that but but it
  514. 23:43seems that
  515. 23:45uh there is more overhead than just the
  516. 23:47the permission checks. There is uh
  517. 23:49overhead and just building these nodes
  518. 23:51in in GraphQL itself. So I I think we'll
  519. 23:54we'll see more slowness as we as we move
  520. 23:58to the work items. um for the database I
  521. 24:01don't think that's that simple because
  522. 24:05um there is overhead in the database as
  523. 24:08we move towards the group level like as
  524. 24:10we move towards group level and also
  525. 24:13group level work items there is more
  526. 24:16database overhead that that may come
  527. 24:18into into play and it will not make
  528. 24:22GraphQL as look as bad if if that makes
  529. 24:25sense right like you it will take quite
  530. 24:28a bit of time like I' I've seen on
  531. 24:30production queries that take like 4
  532. 24:32seconds or something like that to return
  533. 24:34from the database. Right? So now if you
  534. 24:36compare that to the 10-second return or
  535. 24:40whatever from GraphQL then then it
  536. 24:42doesn't look as bad but but it's still
  537. 24:44there is there is a GraphQL overhead for
  538. 24:47sure.
  539. 24:49Yeah. Yeah, on the DB side, I think so I
  540. 24:54on
  541. 24:55the old issues like endpoints or APIs or
  542. 24:59even the GraphQL endpoints, they're I
  543. 25:01think more optimized like we just use
  544. 25:04them longer. We fix the NN plus ones.
  545. 25:06So, you know, if we switch, we'll
  546. 25:09probably find more N plus ones we didn't
  547. 25:10account for. And but in terms of the
  548. 25:13query, they will be pretty much similar
  549. 25:15if it's at the project level. at the
  550. 25:17group level is where it complicates
  551. 25:19things.
  552. 25:20Um especially if we want to do the
  553. 25:23consolidated thing where group and
  554. 25:25project level are
  555. 25:28um returned in one query. That's why we
  556. 25:32temporarily added actually added
  557. 25:34a argument there for the work items
  558. 25:37query where you could say exclude
  559. 25:39projects true so that you could only
  560. 25:42return group level items. We in some of
  561. 25:46our tests earlier we we found that this
  562. 25:49was much faster for now and this
  563. 25:51unblocks the work to switch epics list
  564. 25:53into the work item list. But if we want
  565. 25:56a consolidated list or the you know the
  566. 25:58work Alexander's doing on the project
  567. 26:00level epics and the group level uh
  568. 26:02issues thing and we want them listed in
  569. 26:04one list then we'd have to solve that
  570. 26:06problem still.
  571. 26:08Yeah. Yeah. And for for the group level
  572. 26:10where we exclude projects, that's only
  573. 26:12faster because we have very very few
  574. 26:15group level work items, right? Like we
  575. 26:16have orders of magnitude less epics than
  576. 26:20uh than issues. So it just has to like
  577. 26:24it it efficiently filters by the
  578. 26:26whatever group there is or name space
  579. 26:28and and returns it a bit
  580. 26:30faster. Yeah.
  581. 26:35So yeah, let let's move on to the um the
  582. 26:38topic that I'm kind of excited about
  583. 26:40with the elastic search. Um and we've
  584. 26:43got Dimitri here standing for like 30
  585. 26:46minutes. So I I um I've put it on our
  586. 26:51topic too. Um I do have some questions
  587. 26:55but I think the more generic question is
  588. 26:57like can we
  589. 27:00um rely on as being much faster than
  590. 27:03posgress in a lot of these bigger
  591. 27:08uh data queries sort of to say right
  592. 27:10like where where you need to also search
  593. 27:13the depth of the of the hierarchy tree
  594. 27:15and with a lot of these items um
  595. 27:19obviously there is there are questions
  596. 27:20in terms of can we
  597. 27:23um start using it all over the place or
  598. 27:27is it like the what are the restrictions
  599. 27:30like paid tier versus not paid tier and
  600. 27:32and so on and so forth like I I think
  601. 27:34there is still a bunch of stuff missing
  602. 27:37from ES like I I didn't see filtering by
  603. 27:39milestone I don't think we index
  604. 27:41milestone data and and all that stuff
  605. 27:44and then yeah there there's a lot of
  606. 27:46these questions so the first one is like
  607. 27:48is it is it a paid tier or is it
  608. 27:50available also in force
  609. 27:53So answer that it's paid and registered.
  610. 27:56So but we have I think several issues to
  611. 27:58actually make it available in foss.
  612. 28:02What does it what does register t means?
  613. 28:05I think you can use it for free
  614. 28:07essentially if you agree to send some
  615. 28:10telemetry data if I remember correctly.
  616. 28:12Okay. Okay. Okay. Okay. Okay. I didn't
  617. 28:14know that.
  618. 28:23Uh yeah. So I think we can skip all of
  619. 28:26those questions. We've got the answers
  620. 28:28for that. is like the the bigger
  621. 28:31um question I guess is like if you were
  622. 28:35to Dimmitri if you were to like come to
  623. 28:38plan team now and say okay we wanted to
  624. 28:40use the elastic search like what would
  625. 28:42be your say okay I need to understand
  626. 28:45these uh restrictions in order to tell
  627. 28:48you if it's a good fit or or not so good
  628. 28:52fit like do you have any concerns in
  629. 28:54terms of like us starting and using that
  630. 28:56like what what questions should we asks
  631. 28:58ask ourselves right so what I'm trying
  632. 29:00to uncover here is like what are some of
  633. 29:02the unknowns that we need to look into
  634. 29:04and and investigate um do our kind of
  635. 29:07part of the work right like you need to
  636. 29:09look into this and this and that cuz
  637. 29:10like it probably will perform okay here
  638. 29:13but but maybe not you need to
  639. 29:14investigate so in my mind it will be
  640. 29:17much much more performant given how much
  641. 29:20we we our team struggled with posgress
  642. 29:23especially with group level searches I
  643. 29:26think that's the
  644. 29:27That's really important for this working
  645. 29:30group. It's to search something in a
  646. 29:32name space and I think posgress just
  647. 29:35doesn't really work for that use case.
  648. 29:39My main not even concerned I think the
  649. 29:42main challenge is
  650. 29:44finders. If we want to support both
  651. 29:46posgress and elastic search we'll need
  652. 29:48to change how we how we operate in
  653. 29:52regards to finders. So I've even opened
  654. 29:55a design document recently
  655. 29:58uh that we need to not return advance uh
  656. 30:02sorry active record scopes we'll need to
  657. 30:04return actual pageentated results if you
  658. 30:07want to support both
  659. 30:08backends. So that's the main challenge
  660. 30:11in my mind. If you want to migrate
  661. 30:13towards that new world when if you have
  662. 30:17advanced search you're using advanced
  663. 30:18search if not you're still using
  664. 30:20posgress we need these new
  665. 30:23finders because our team but that that
  666. 30:26would mean if we want it to be like
  667. 30:28transparent in in the sense that user
  668. 30:30doesn't have to know which back end it's
  669. 30:32using right but if they have to make the
  670. 30:35decision explicit then you can have
  671. 30:38different fighters for the different use
  672. 30:40cases like Right. Is is my understanding
  673. 30:43correct there?
  674. 30:44Uh potentially, but I I was hoping that
  675. 30:48we can make it more transparently maybe.
  676. 30:51Yeah. Yeah. I mean there are there there
  677. 30:52are obviously pluses for that because
  678. 30:54you can have one front end dealing with
  679. 30:56with the two backends at the same time.
  680. 30:59Um it it really comes down to what's the
  681. 31:03cost, right? Can we implement such
  682. 31:04finders easier or is it easier to to
  683. 31:07have two front ends basically dealing
  684. 31:09one will deal with the with the active
  685. 31:11record scope another one will deal with
  686. 31:13the just an array uh but yeah I just I'm
  687. 31:17just trying to understand what what's
  688. 31:19your what's your vision in that and that
  689. 31:21that's like we want that finders if we
  690. 31:23want one front end and then the back end
  691. 31:25is basically transparently moving
  692. 31:26between oh I'm actually will be much
  693. 31:30more performant to use elastic search so
  694. 31:32the decision is not on the user but it's
  695. 31:34rather on on our own back end. Okay. I I
  696. 31:37was thinking we will have maybe a set of
  697. 31:38filters advanced search finder support.
  698. 31:42Maybe we don't have milestones yet then
  699. 31:45we will fall back to using posgress and
  700. 31:47then we can migrate all these fields to
  701. 31:50the advanced search finder kind of and
  702. 31:53if all of the filters are supported we
  703. 31:56just use advanced search. I think it
  704. 31:58will always be more performant than
  705. 32:00posgress
  706. 32:02but we don't have yet any examples in in
  707. 32:05gitlab that uses both and does this
  708. 32:08fallback right like there is nothing
  709. 32:09that does that today so slash search
  710. 32:12page does that if advanced search is
  711. 32:15disabled we use posgress so we already
  712. 32:18kind of do that but yeah but the
  713. 32:20decision is on the the decision is
  714. 32:22coming from the front end right it's not
  715. 32:25it's not a decision that's on on the
  716. 32:28back end itself is like on on the back
  717. 32:31end. Yeah. Okay.
  718. 32:34If if you don't have advanced search
  719. 32:36enabled, we just use posgress. We call
  720. 32:38it basic search. It's much much slower,
  721. 32:42but it's available.
  722. 32:44Yeah. But does it like go through the
  723. 32:46same like what do you call like a finder
  724. 32:49code or like it's just a different HAML,
  725. 32:51different finder, different everything
  726. 32:53like So it's the same HAML file. We we
  727. 32:57use search services and these have kind
  728. 33:02of this decision tree whether or not
  729. 33:04elastic search is available whether or
  730. 33:06not this specific thing is indexed in
  731. 33:08advanced search and then we decide which
  732. 33:12back end we should use but it's very
  733. 33:15search specific so that's why I'm
  734. 33:16talking about finders maybe you can
  735. 33:19utilize finders to use it more broadly
  736. 33:22in GitLab
  737. 33:33And the link you posted is the wild card
  738. 33:35s. So I'm assuming like it could also
  739. 33:39eventually replace the list view like
  740. 33:41even without filters, right? Like
  741. 33:44or yep I believe so. So we have an old
  742. 33:49epic specifically about that about using
  743. 33:52advanced search with merge request lists
  744. 33:54and issue lists but we haven't
  745. 33:58prioritized it. I think this working
  746. 34:00group might be a really good opportunity
  747. 34:02for us to to actually pursue
  748. 34:08that. My only concern is I it's not
  749. 34:12really a big concern but like if you
  750. 34:14look at the issue list right now there
  751. 34:16are so many
  752. 34:17like edge cases like sorting by
  753. 34:22um priority or something. So should we
  754. 34:24index all the label priorities and all
  755. 34:26that and yes and you know to sort
  756. 34:28through that or like you know those are
  757. 34:30not very commonly used but if you want
  758. 34:32like full parity between both then we'd
  759. 34:34have to have to handle these you know
  760. 34:37edge uh cases that we need to support um
  761. 34:41so elastic in
  762. 34:43indexes all the fields so it's just a
  763. 34:46question to add these fields to elastic
  764. 34:49search to our indices we have advanced
  765. 34:52search migration framework which makes
  766. 34:54it really easy. So you add a field to
  767. 34:56back fill it and you can use it as soon
  768. 34:59as the back fill is
  769. 35:02completed. Yeah. But this like for
  770. 35:05example a complex search is like uh like
  771. 35:08I said priority is
  772. 35:10like depends on the issues labels and
  773. 35:13the labels priority set somewhere else
  774. 35:15right in another table. So if those
  775. 35:18priorities change, this issue list
  776. 35:19should change. It should like trigger a
  777. 35:22reindex or something or should we just
  778. 35:24those kinds of things? Yeah, I think we
  779. 35:27have something similar when let's say
  780. 35:29project permissions change, we reindex
  781. 35:33all associated documents. So I think
  782. 35:35it's pretty similar to that. We'll need
  783. 35:37to
  784. 35:38denormalize some fields to elastic
  785. 35:41search to this index because we can't
  786. 35:43really do joins in elastic search.
  787. 35:50The other thing I remember from the last
  788. 35:52conversation I had with like ES thing
  789. 35:54before was uh the cost. I think the ES
  790. 35:58team mentioned that before that we were
  791. 36:01not ready to
  792. 36:03handle you know much more ES queries at
  793. 36:06that time. I don't know the current
  794. 36:07situation though. I think it's much
  795. 36:10better now. So more than 90% of our
  796. 36:13storage is code and we have zuk now
  797. 36:17exact code search which will kind of
  798. 36:19replace advanced search for that and I
  799. 36:22think other document types like work
  800. 36:25items are ne negligible compared to
  801. 36:28code. So have a huge huge cluster with
  802. 36:30billions of documents in it at the
  803. 36:33moment.
  804. 36:36Uh Duke is there anywhere where we can
  805. 36:38learn about like performance of
  806. 36:40reindexing all this stuff like going
  807. 36:42back to what what Hinrich just mentioned
  808. 36:45in like you've changed the um priority
  809. 36:49so you need to to to change those
  810. 36:50indexes to basically reindex a bunch of
  811. 36:52documents and that will come also true
  812. 36:56because we have this work like custom
  813. 36:57work item types so your type is
  814. 37:00currently called issue but then it
  815. 37:01becomes being
  816. 37:03colic ally need to add that data to the
  817. 37:06elastic search now um because it it has
  818. 37:09been saved to the database right you
  819. 37:10need to do this whole migration my my
  820. 37:12question is like how much data can we
  821. 37:14process in a unit of time or like some
  822. 37:16kind of performance understanding in
  823. 37:18that how fast that can be available in
  824. 37:21searches right because like you've
  825. 37:22changed it and now you be you need to be
  826. 37:24able to work with your boards and and
  827. 37:26and everything else um at the same time
  828. 37:29that's something that we still need to
  829. 37:31solve for posgress as well and we we're
  830. 37:34thinking thing about this decorator
  831. 37:35pattern where where it uh propagates the
  832. 37:37change like you did not yet change the
  833. 37:40type itself but you can see how how it
  834. 37:42the change is being applied so maybe we
  835. 37:44can do some magic in that context but
  836. 37:46maybe we can just reindex it at the same
  837. 37:49time and and return it I think it should
  838. 37:52be fine right now the delay is up to a
  839. 37:54minute but it's easily we can easily
  840. 37:56change that to be several seconds so if
  841. 38:00we don't have oh sorry so you can you
  842. 38:02can index like what like a thousand
  843. 38:04issues per minute or do you have any
  844. 38:07kind of understanding of how obviously
  845. 38:09it depends on how much data that or
  846. 38:11maybe in megabytes we can say you can
  847. 38:13index like 1 kilobyte per second or
  848. 38:15something do we have any kind of
  849. 38:17measures measurements in that sense I
  850. 38:19think we have saved somewhere but it was
  851. 38:22really really high indexing for I think
  852. 38:25a day or two and then we processed the
  853. 38:28entire backlog maybe half a million of
  854. 38:30documents or something maybe in 10
  855. 38:33minutes I don't remember specifically
  856. 38:35but it was really good and we have
  857. 38:37sharding so we have 16 shards for
  858. 38:40indexing so if if we see that the
  859. 38:43current throughput is not enough we can
  860. 38:45just add more shards but we've never had
  861. 38:48problems with indexing throughput uh and
  862. 38:51one more question would uh plan related
  863. 38:54stuff be on a kind of separate cluster
  864. 38:57or is it all within the same so what I'm
  865. 38:59trying to say is like if um well code is
  866. 39:03probably se is going to be separated in
  867. 39:04zooked. But if some other part of the
  868. 39:06search fails, uh will plan be affected
  869. 39:09or can we make it so that like wikis
  870. 39:12cannot be searched but but uh issues can
  871. 39:15be searched right like I think we need a
  872. 39:18much higher availability for issues than
  873. 39:21something else in searches because it
  874. 39:23affects like boards, lists, all of that
  875. 39:26all of that workflow. So my question is
  876. 39:28can we have it separate or it has to
  877. 39:30like the the current architecture is
  878. 39:32everything has to leave it in the same
  879. 39:34uh same infra. So that's possible
  880. 39:37potentially possible but right now it's
  881. 39:40a single cluster with multiple nodes. We
  882. 39:44have work items index. So if something
  883. 39:47goes wrong with the cluster it would it
  884. 39:50would potentially affect work items as
  885. 39:52well. But we could discuss maybe some
  886. 39:55mitigation strategies if we want. Also,
  887. 39:58we could potentially fall back to
  888. 40:00posgress if something goes wrong so that
  889. 40:03we can at least still maintain the
  890. 40:05functionality even though it won't be as
  891. 40:07performant.
  892. 40:09Yeah. The the worry is that we will not
  893. 40:11be able to maintain like same kind of UI
  894. 40:14and features like the same boards and
  895. 40:16all that if with the two back ends,
  896. 40:18right? you you I can see a world where
  897. 40:20you can have a simplified UI and
  898. 40:23features versus if you have elastic
  899. 40:26search you have a lot more stuff going
  900. 40:28on there and when that falls it will
  901. 40:30just not serve the same boards right
  902. 40:32that board will have different
  903. 40:33configurations and and all different
  904. 40:36filters different different everything
  905. 40:38so it'll probably not be as easy to to
  906. 40:41to be as transparent because I don't
  907. 40:43think we can support everything in both
  908. 40:45places but yeah anyway um one other
  909. 40:48question that I have is about custom
  910. 40:50fields and I'm not sure if that's
  911. 40:52something if that will be a concern at
  912. 40:54all for elastic search in in that it's
  913. 40:57not exactly dynamic. We kind of know the
  914. 41:02name of the field and we we know the
  915. 41:04type as well because we wanted to know
  916. 41:06like the type of the field in the
  917. 41:07database anyway. But I don't know if
  918. 41:09that raises any concerns to you as well
  919. 41:11or I think you've answered but I didn't
  920. 41:14catch it.
  921. 41:16Yeah. So we could potentially add a
  922. 41:18nested field, nested object field, but I
  923. 41:23think we we might want to discuss uh to
  924. 41:26sync on that se separately to see the
  925. 41:30maybe requirements for custom fields
  926. 41:33whether or not we want to introduce the
  927. 41:35these
  928. 41:36dynamically or we know all the fields
  929. 41:39and we can add them to our index in
  930. 41:42advance.
  931. 41:44No, we we don't know the fields. They
  932. 41:46will be defined by the customers. We
  933. 41:47know that we have a limited set of
  934. 41:49fields like we we only can have a 100
  935. 41:52custom fields max but
  936. 41:54then those will be added dynamically by
  937. 41:57the customers like they they can have
  938. 41:59two or they can have 20. We don't we
  939. 42:02cannot know at least that's how it's
  940. 42:04designed today. Maybe we need to revisit
  941. 42:06that but yeah I see. Yeah. and and we
  942. 42:10need all the functionalities on an
  943. 42:12ordinary field potentially. It's not
  944. 42:14going to come all at once, but we would
  945. 42:16want to be able to filter, to sort by
  946. 42:18them, to group by them, and all all all
  947. 42:20that stuff.
  948. 42:23Yeah. Uh we have quite a bit of the
  949. 42:26agenda ahead of us. Can we maybe move to
  950. 42:28the next point?
  951. 42:31Thank you. Uh the next one is I think
  952. 42:35mostly it's covered but like um I
  953. 42:37mentioned like it's not really the DB
  954. 42:39that's the biggest chunk right now is
  955. 42:41that the linked items N plus1 I think
  956. 42:44it's assigned to Eugenia so she's
  957. 42:45probably working on that already and
  958. 42:47like there's another N plus one on the
  959. 42:50um redacted user which is like uh more
  960. 42:55of a problem for our project because we
  961. 42:57have a lot of like bot created like the
  962. 42:59test failure issues and they're all
  963. 43:01created by the bot and every time
  964. 43:02there's a bot user, we redact we check
  965. 43:05if we have access to that bot's project
  966. 43:08so that we can redact the name if you
  967. 43:10don't have the access to that project
  968. 43:11and like yeah it creates these uh N plus
  969. 43:15ones
  970. 43:29and if there are no comments And Alice,
  971. 43:32I guess you have a next point.
  972. 43:35Yes. Um, so, uh, after the last session,
  973. 43:40uh, I think for me there was a lot of
  974. 43:42listening, but afterwards processing it
  975. 43:44all, I was like, hm, uh, there are so
  976. 43:46many of the raised issues that can be
  977. 43:48potentially fixed with elastic search
  978. 43:51and that's why I asked Mitri to have a
  979. 43:54call and we started discussing it
  980. 43:56everything probably mostly from GLQL
  981. 43:58scope. Uh and yeah, I realized that like
  982. 44:02there is a lot of in place that we can
  983. 44:04potentially start using. uh and I
  984. 44:07thought like it's important just to
  985. 44:09narrow the scope because we're now
  986. 44:11discussing so many things and if just
  987. 44:13like trying to grasp everything it might
  988. 44:14be overwhelming and um um then uh also
  989. 44:19another thing I think you mentioned not
  990. 44:22everyone has uh elastic search because
  991. 44:24you were considering this before not
  992. 44:26everyone has uh elastic search on
  993. 44:27self-hosted instances but then again
  994. 44:30uh if it's a bigger customer they're
  995. 44:33potentially already using elastic search
  996. 44:36and they will actually might uh like
  997. 44:39this possibility to scale for them uh
  998. 44:41themselves and then uh optimizing thing
  999. 44:44for gitlab.com that's already a huge
  1000. 44:47win. Uh so I thought of focusing on
  1001. 44:51subgroups like searching through
  1002. 44:53different subgroups because specifically
  1003. 44:54for JLQL like one of the biggest
  1004. 44:58advantages of using it in one place you
  1005. 45:00can have uh you can plan your work
  1006. 45:03through different hierarchies different
  1007. 45:05name spaces and uh at the moment this
  1008. 45:09most probably is going to time out uh
  1009. 45:13and doing this through elastic search
  1010. 45:16possibly it's going to work pretty fast
  1011. 45:18and Midri already mentioned that they
  1012. 45:20did quite some optimization for this in
  1013. 45:22elastic search because uh code uh uh
  1014. 45:25code team were are already also using
  1015. 45:28this for their purposes. Uh so I created
  1016. 45:31a proof of concept uh issue for us to
  1017. 45:34start collaborating and uh yeah try to
  1018. 45:37connect it on back end for JLQL. uh uh
  1019. 45:40if elastic search is available then also
  1020. 45:42feature flag potentially also maybe some
  1021. 45:44URL params so that like if feature flag
  1022. 45:46is enabled we can switch to uh uh
  1023. 45:50graphql then elastic search and just to
  1024. 45:52see like what's the the the yeah time
  1025. 45:54difference how like are the results
  1026. 45:56similar uh and uh maybe having this
  1027. 46:00small step of us connecting it uh then
  1028. 46:03we can build on that um yeah I think
  1029. 46:07yeah I think that's like the the the
  1030. 46:10overview of the the the potential thing
  1031. 46:12we would like to try out for Jok.
  1032. 46:18Yeah, I I think that's a good idea to
  1033. 46:20have some sort of a proof of concept
  1034. 46:22with the elastic search. What I would
  1035. 46:25what I would suggest in a way is to pick
  1036. 46:28something that we have in posgress and
  1037. 46:30then try to do that same thing in in uh
  1038. 46:33elastic search so that we can compare
  1039. 46:36somewhat apples to apples. It's not
  1040. 46:38going to be apples to apples obviously
  1041. 46:39because like the two beckons but uh as
  1042. 46:42close as possible. So then it will be an
  1043. 46:44easier like you already mentioned it
  1044. 46:46will be an easier comparison to
  1045. 46:48understand like what are the potential
  1046. 46:49gains and and and whatnot. Um because
  1047. 46:52otherwise if we do it totally different
  1048. 46:54it will be kind of different. It'll be
  1049. 46:56also a easier cell I would say to
  1050. 46:58product as well in in and all that. Um
  1051. 47:01if you if we see a nice performance
  1052. 47:04improvement and and all that. Yeah. So
  1053. 47:07yeah that's that's a good suggestion I
  1054. 47:10did
  1055. 47:12identifying slow queries uh which uh for
  1056. 47:17which the fields already exist in
  1057. 47:19elastic search just not to spend time on
  1058. 47:21reindexing data. So we will try to find
  1059. 47:23solo query uh which data is in elastic
  1060. 47:27search and we'll try to replicate that.
  1061. 47:34Yeah, like even adding something I think
  1062. 47:35locally it should be pretty fast. And
  1063. 47:37again like if if that's something that
  1064. 47:40locally
  1065. 47:41is slower you you gain locally like x
  1066. 47:45times the the speed then that's also a
  1067. 47:47good uh proof I would say and then we
  1068. 47:51can expand it to a specific group in
  1069. 47:54production or whatnot.
  1070. 47:58Uh Mitri, was there anything I missed
  1071. 48:00and you wanted to add because we
  1072. 48:02discussed a lot of things last week.
  1073. 48:04Uh maybe only one question. Do we want
  1074. 48:07to focus on namespace searches? So is it
  1075. 48:11possible to use to include subgroups for
  1076. 48:15JLQL? Maybe we can have side by side
  1077. 48:18because I think elastic search is the
  1078. 48:22strongest point is for namespace
  1079. 48:24searches. It's possible. And I think
  1080. 48:26what we'd want to actually look at into
  1081. 48:29is a unified query where we get group
  1082. 48:34level work items and project level work
  1083. 48:37items and you query them for instance
  1084. 48:39from GitLab work uh level right some
  1085. 48:42like some some root level group and now
  1086. 48:44you want give me all the epics issues
  1087. 48:47and tasks for instance right um with
  1088. 48:50these filters I don't know maybe labels
  1089. 48:51maybe I don't know what what we have in
  1090. 48:53in elastic search but some kind of a
  1091. 48:55query that we can build. I think we have
  1092. 48:58work items route today uh at the GitLab
  1093. 49:02work group level. So then you can build
  1094. 49:04some sort of a query and see and see
  1095. 49:06what the posgress and what the GraphQL
  1096. 49:08is for that but not as like simple
  1097. 49:11enough that it can be replicated in uh
  1098. 49:13in elastic search but at the same time
  1099. 49:15it will probably take quite a bit of
  1100. 49:17time to to return results.
  1101. 49:29That that having said it's it still
  1102. 49:31sounds like we should try and focus some
  1103. 49:34of our time into improving the GraphQL
  1104. 49:36overhead because like regardless if it's
  1105. 49:39going to be through the posgress back
  1106. 49:42end or the elastic search back
  1107. 49:44end if we are going to use the GraphQL
  1108. 49:47API to return or the the GraphQL as a
  1109. 49:50front-end interface turning turn data is
  1110. 49:52like the overhead is is is quite big. Um
  1111. 49:57so yeah
  1112. 49:59actually uh I wanted to kind of pick
  1113. 50:04like uh on the action items for the next
  1114. 50:07one. So it looks like um at the moment
  1115. 50:11Hinrich you still be looking in the slow
  1116. 50:15kind of the database side of things
  1117. 50:17right? uh potentially on the group level
  1118. 50:20as well.
  1119. 50:22Yeah. And uh Alexander, do you still
  1120. 50:25plan to investigate the GraphQL further?
  1121. 50:29The overhead? I I don't have much there.
  1122. 50:31Like I I've hit a bit of a wall because
  1123. 50:34I don't understand how we can like all
  1124. 50:36of the all of all that I'm seeing in
  1125. 50:39Flame Graves is is GraphQL internals
  1126. 50:43basically. So, I'm not sure like what
  1127. 50:47I'd love to pair with someone who has
  1128. 50:48more knowledge into GraphQL potentially
  1129. 50:51where I don't know um or I'm I'm open to
  1130. 50:54to collaborate with whoever is has more
  1131. 50:56knowledge into GraphQL, but otherwise I
  1132. 50:58don't know uh what to do there to to be
  1133. 51:01honest. I'm I'm kind of stuck um into
  1134. 51:04improving the the GraphQL overhead on
  1135. 51:07its own. I think we need to clear out
  1136. 51:11the N plus1's first before you can
  1137. 51:14get a better picture of the flame graph
  1138. 51:16and like because with there are
  1139. 51:18repeating parts, right? So it's kind of
  1140. 51:20like hard. I've removed I've I've
  1141. 51:22removed the M plus ones from my query.
  1142. 51:24So like in my testing I actually remove
  1143. 51:26the linked item so that I'm I'm not
  1144. 51:29affected by the N plus1's because I've
  1145. 51:31discovered that as well. So I just
  1146. 51:32removed that widget altogether. Um so
  1147. 51:36I'm not I'm not seeing N plus1's on the
  1148. 51:38database side for for myself uh on my
  1149. 51:41local testing. But again, the overhead
  1150. 51:43is just like immense. Uh like 50
  1151. 51:46milliseconds on the database side versus
  1152. 51:48like 10 seconds or something like that
  1153. 51:50to get that data out um through the
  1154. 51:53whole query is just too much.
  1155. 51:57It's interesting to say you don't see
  1156. 51:58any N plus ones
  1157. 52:01um besides the related links because
  1158. 52:03there are I think many in there.
  1159. 52:06Uh no, I'm not seeing them in the
  1160. 52:09database. I like uh I I don't maybe the
  1161. 52:12data that I'm having locally is not uh
  1162. 52:16returning some of the results. I I don't
  1163. 52:17know. I don't have the data. Maybe
  1164. 52:18that's not that's why I'm getting that.
  1165. 52:21But yeah, I I didn't see um I didn't see
  1166. 52:25any of the obvious M plus ones.
  1167. 52:28Is there anyone here who has more
  1168. 52:31experience with the GraphQL
  1169. 52:33internals or do you know anyone in
  1170. 52:37GitLab
  1171. 52:38who would be good to pair
  1172. 52:45with? Maybe I can help with that. Like
  1173. 52:49I've looked into the tracing code stuff.
  1174. 52:51So I'm also curious about the thing that
  1175. 52:53you said about the the difference you
  1176. 52:56see on like how long the DB returns the
  1177. 52:59data versus you know how long it takes
  1178. 53:01to serialize the data to this JSON
  1179. 53:04thing. So I think yeah I can I can put
  1180. 53:07something on our on the notes thing
  1181. 53:09right. So it's like this is a similar
  1182. 53:11thing and yeah we could I I I can I can
  1183. 53:14put something on our calendar and at
  1184. 53:15least I can present what I have and and
  1185. 53:18then we can we can see how we can split
  1186. 53:20the work or what we can find. But yeah
  1187. 53:23I'll I'll I'll take that offer and uh
  1188. 53:25Sure. Thanks.
  1189. 53:29Cool.
  1190. 53:31Uh so yeah from now on the like the
  1191. 53:33action items uh Henrik you're looking at
  1192. 53:35the SQL Alexander and Henrik you uh
  1193. 53:38together looking at the GraphQL Eugene
  1194. 53:41as I understand focusing on this N plus
  1195. 53:43ones right? Uh yeah the linked items
  1196. 53:45ones is the one I'm focusing on now.
  1197. 53:48Yeah and Alissa is working on the
  1198. 53:51elastic search PC. Uh anything else from
  1199. 53:56the like what what what does everybody
  1200. 54:00else wants to work on? Uh something I I
  1201. 54:03found earlier when testing the the
  1202. 54:05difference with widgets um is
  1203. 54:09considering the the queries when we
  1204. 54:11don't have a current user. So in um some
  1205. 54:16items are still accessible because
  1206. 54:18they're public. And so I found we we
  1207. 54:21have a bug now that we're not um we
  1208. 54:23don't have access to those items. But
  1209. 54:25once you feed fix the bug uh those
  1210. 54:28queries are really really slow and I
  1211. 54:30don't know if something that we want to
  1212. 54:32consider eventually um like about 20
  1213. 54:35seconds uh some of them and I think it's
  1214. 54:39because maybe I don't know maybe there's
  1215. 54:42something we can improve there maybe
  1216. 54:44even in the finder of returning things
  1217. 54:48earlier or doing less authorization
  1218. 54:51um something to consider maybe less
  1219. 54:53priority
  1220. 54:55I think that's overlapping with the work
  1221. 54:57that I was wanting to work. Uh that
  1222. 55:01issue related to the when the user has
  1223. 55:04access doesn't has access or is not uh
  1224. 55:07authenticated. I haven't started that
  1225. 55:09yet because my pipelines are all red but
  1226. 55:12I think it's overlapping there right
  1227. 55:18and one more question from my side. Do
  1228. 55:20you think it's worth it to look into the
  1229. 55:22P band user denormalization?
  1230. 55:28Yeah, I looked at the queries and like
  1231. 55:31um it's not right now I don't think it
  1232. 55:35is a feasible thing because like earlier
  1233. 55:38I was showing them like uh the
  1234. 55:40comparison between adding a work item
  1235. 55:42type query because the default right now
  1236. 55:44is we have a work item type ID clause
  1237. 55:46and the um what's this band user clause
  1238. 55:50right um so switching that exists query
  1239. 55:53into something like
  1240. 55:56uh issue hidden equals false or
  1241. 55:59something if we denormal denormalize
  1242. 56:01that into a boolean right it's going to
  1243. 56:04be similar to the two clause thing where
  1244. 56:06you can't have a single index I mean you
  1245. 56:09can if you add an index for everything
  1246. 56:11you know and add a hidden field on every
  1247. 56:14index but the main problem right now is
  1248. 56:16that if if you don't have this sorted
  1249. 56:18index then it will be fetching all the
  1250. 56:20issues that m match all the conditions
  1251. 56:22and then sorting in memory And I found
  1252. 56:25that that's the slow part right now. Um
  1253. 56:28especially with a group level when there
  1254. 56:29are a lot more. So right now there's
  1255. 56:31like I'm testing on GitLab or GitLab
  1256. 56:33with 75,000 um issues and it sorts into
  1257. 56:36memory, fetches into memory and sorts
  1258. 56:38them takes like 500 milliseconds or so
  1259. 56:41right now. Okay, makes sense. Yeah, for
  1260. 56:43my testing the band user query only
  1261. 56:44performed better if I was able to
  1262. 56:47denormalize it. Like I used hidden or
  1263. 56:49whatever and then added an index on it.
  1264. 56:51before adding the index there was no
  1265. 56:54improvement as you said.
  1266. 56:56Yeah.
  1267. 57:00Okay. Cool. And we are at actually 10
  1268. 57:04minutes over time.
  1269. 57:05Uh any other like points that we want to
  1270. 57:09discuss
  1271. 57:10sync and
  1272. 57:13quickly? No.
  1273. 57:15Uh then thank you everyone for very
  1274. 57:18productive discussions and all the work
  1275. 57:20that you've done over the week. Uh so
  1276. 57:22yeah let's continue. Looks like there is
  1277. 57:25a lot we can do to improve there. Bye
  1278. 57:28everyone.

About this transcript

This page contains the full transcript of Work Items API performance WG - 2025-03-11 by GitLab Unfiltered, generated from the public captions YouTube serves with the video. The transcript has 8,972 words across 1,278 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.