[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH] [db] Create indexes for (pkg_name, version) in suite_{sources,binaries}



On Thu, Mar 05, 2009 at 08:19:00PM +0100, Adeodato Simó wrote:
> These two indexes make faster joins between sources and suite_sources,
> and binaries and suite_binaries, since the join key will be indexed on
> both sides. The difference is particularly noticeable for the binaries,
> since suite_binaries has more than half a million rows.

> +CREATE INDEX suite_sources_src_ver_idx ON sources (source, source_version);

I'm not sure about this index.  Isn't it already created automatically:

# \d sources
[...]
Indexes:
    "sources_pkey" PRIMARY KEY, btree (source, version)
    "sources_pkg_idx" btree (source)
[...]

>  );
>  
> +CREATE INDEX suite_binaries_pkg_ver_idx ON suite_binaries (package, version);

I agree with the one.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.


Reply to: