pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sumeet Ambre <sambre@indiana.edu>
To: Andrew Sullivan <ajs@crankycanuck.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: Multiple DB join
Date: Tue, 15 Aug 2006 10:11:41 -0400
Message-ID: <44E1D61D.4020400@indiana.edu> (raw)
In-Reply-To: <20060815103624.GA21634@phlogiston.dyndns.org>
References: <44E0EA72.2090505@indiana.edu>
	<20060815103624.GA21634@phlogiston.dyndns.org>

Andrew Sullivan wrote:
> On Mon, Aug 14, 2006 at 05:26:10PM -0400, Sumeet Ambre wrote:
>   
>> Hi All,
>>
>> I have a database which consists of 20 million records and I've split up 
>> the db into 6-7 dbs. 
>>     
>
> You can do this (as someone suggested with dblink), but I'm wondering
> why the split?  20 million records isn't very big.
>
> A
>   
The Design of the database is because our organization wants to split up 
different datasets into different entities, and there might be a 
possibility that they'll run different instances of postgres for each 
dataset. The problem is that one of the databases consists of 14 million 
records and when i query the base database which consists of 20million 
records, the query runs damn slow.......below is the sample schema for 
my base table and the query i try to run on it....it takes me more than 
2-3 minutes to run a query....Is there any way i could speed this up......

sample schema for my base table
---------------------------------

doc_id  |  title |  authors  |  pub_year  |   abs   |   db_name........ |

In the above scheme the field db_name is the name of the other databases 
which contain the whole record.
I'm trying to run query which searches on title, authors name, pub_year 
or abstract simultaneously...

e.g.  SELECT * FROM base WHERE ((title ILIKE '%something%') AND (authors 
~*   '.*something.*')  AND (db_name='something'));

Any suggestions to speed up this query.....

Thanks,
Sumeet.



view thread (14+ messages)  latest in thread

Message-ID: <44E1D61D.4020400@indiana.edu>
Permalink:  ../44E1D61D.4020400@indiana.edu/
Also on:    postgresql.org/message-id/44E1D61D.4020400@indiana.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sambre@indiana.edu, ajs@crankycanuck.ca
  Subject: Re: Multiple DB join
  In-Reply-To: <44E1D61D.4020400@indiana.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox