[Catalog-sig] start on static generation, and caching - apache config.

"Martin v. Löwis" martin at v.loewis.de
Tue Jul 10 23:29:14 CEST 2007


> It doesn't.  It looks at /pypi/ (note the trailing /) -- which lists all
> packages.

Ah, ok. I keep forgetting that feature.

>> Would it be acceptable to do an HTTP redirect in that case, ie.
>> redirect /pypi/pylons/0.9.5 to /pypi/Pylons/0.9.5?
> 
> Yes, although setuptoools at the moment looks at /pypi/pylons/ (again,
> with a trailing /) and does not go to individual version pages unless
> the base page contains only links to individual version pages.

Right - I meant that to mean that it would redirect /pypi/Pylons/ to
/pypi/pylons/

> I think this will work instead:
> 
>    select name from packages where name ~* 'gnosis[^a-z0-9.]+utilities'

Ok. I was hoping to be able to create an index of safe_names, which
postgres would automatically maintain on updates; the above approach
would always cause a sequential scan (in postgres, not in Python).

Your second approach (using like) might solve that, but there I
dislike having the logic both in Python and in SQL - ideally, only
one of them should do "real" computation (and ideally, it would be
SQL).

On ximinez, your query gets analyzed as

 Seq Scan on packages  (cost=0.00..46.65 rows=1 width=13) (actual
time=0.461..9.367 rows=1 loops=1)
   Filter: (name ~* 'gnosis[^a-z0-9.]+utilities'::text)
 Total runtime: 9.413 ms

Compared to some other queries it performs, that's a cheap one.

> In any case, this query should also be used to check for uniqueness when
> adding packages.

Hmm. I'm somewhat skeptical about setuptools (or any other packaging
infrastructure, say, Debian) establishing rules on what makes a
difference in package names.

Regards,
Martin


More information about the Catalog-SIG mailing list