<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 28, 2017 at 4:52 PM, Jeff Ortel <span dir="ltr"><<a href="mailto:jortel@redhat.com" target="_blank">jortel@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
</span>I considered storing the base path in the Publication. But I don't see how the query using the /path/<br>
component of the URL could be indexed if the path is split between the Publication and the LinkedArtifact.</blockquote></div><br>Ah yes! When I was hurriedly writing earlier, I knew there was some algorithmic problem related to paths but couldn't remember what it was. This is it. It's solvable, but at some point you need all the base paths in a tree structure that the serving app can use to find the correct match to a full path, similar to traversing directories in a filesystem. Or you need some other equivalent algorithm.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Quickly brainstorming on that though...</div><div class="gmail_extra"><br></div><div class="gmail_extra">Assume we have a restriction that for any given base path, it must not reside within any other base path. We have that restriction today with yum repos.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Given a path with n segments, for example /a/b/c/foo.rpm would have 3 segments, the serving app could break it up into n possible base paths: /a/, /a/b/, /a/b/c/. It can do one database search on publication base paths for all n possible paths, and should only get one or zero results. If that field is indexed, this could be a quick way to find the right publication. Something like:</div><div class="gmail_extra"><br></div><div class="gmail_extra">Publication.objects.get(base_path__in=['/a/', '/a/b/', '/a/b/c/'])</div><div class="gmail_extra"><br></div><div class="gmail_extra">Granted, then you must do a second DB query for the published artifact within that publication. But this should all be a very small portion of the total time it takes to actually transmit the file itself, and I could easily believe this is as fast as reading a symlink off of an NFS mount.</div><div class="gmail_extra"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><p style="color:rgb(0,0,0);font-family:overpass-mono,monospace;font-size:10px;margin:0px!important;padding:0px!important"><span style="margin:0px!important;padding:0px!important">Michael</span> <span style="margin:0px!important;padding:0px!important">Hrivnak</span></p><p style="color:rgb(0,0,0);font-family:overpass-mono,monospace;font-size:10px;margin:0px!important;padding:0px!important"></p><span style="color:rgb(0,0,0);font-family:overpass-mono,monospace;font-size:10px;margin:0px!important;padding:0px!important"><span style="margin:0px!important;padding:0px!important">Principal Software Engineer</span><span style="margin:0px!important;padding:0px!important">, <span style="margin:0px!important;padding:0px!important">RHCE</span></span> </span><span style="color:rgb(0,0,0);font-family:overpass-mono,monospace;font-size:10px"></span><br style="color:rgb(0,0,0);font-family:overpass-mono,monospace;font-size:10px;margin:0px!important;padding:0px!important"><p style="color:rgb(0,0,0);font-family:overpass-mono,monospace;font-size:10px;margin:0px!important;padding:0px!important">Red Hat</p></div></div>
</div></div>