[Pypi-checkins] r954 - trunk/pypi

richard python-checkins at python.org
Tue Aug 23 03:13:55 CEST 2011


Author: richard
Date: Tue Aug 23 03:13:55 2011
New Revision: 954

Modified:
   trunk/pypi/store.py
Log:
better newest package SQL; thanks Andy Todd

Modified: trunk/pypi/store.py
==============================================================================
--- trunk/pypi/store.py	(original)
+++ trunk/pypi/store.py	Tue Aug 23 03:13:55 2011
@@ -885,11 +885,14 @@
         # is "small".
         statement = '''
             select j.name, r.version, j.submitted_date, r.summary
-              from (select name,version,submitted_date from journals
-                     where action='create' order by submitted_date desc %s) j,
-                   releases r
-             where j.name=r.name and r.version is not NULL
+              from releases r
+                   JOIN (SELECT name, max(submitted_Date) submitted_date
+                         FROM  journals GROUP BY name) j ON j.name = r.name
+             where r.version is not NULL
                and not r._pypi_hidden
+               and r.name in (SELECT name FROM journals
+                              WHERE  action='create'
+                              ORDER BY submitted_date DESC %s)
              order by j.submitted_date desc'''
         #print ' '.join((statement % limit).split())
         safe_execute(cursor, statement % limit)


More information about the Pypi-checkins mailing list