Re: 2 million queries against a table - Mailing list pgsql-general

From Tom Lane
Subject Re: 2 million queries against a table
Date
Msg-id 3077129.1594827537@sss.pgh.pa.us
Whole thread Raw
In response to 2 million queries against a table  (Adam Sanchez <a.sanchez75@gmail.com>)
Responses Re: 2 million queries against a table
List pgsql-general
Adam Sanchez <a.sanchez75@gmail.com> writes:
> I need to run 2 million queries against a three columns table t
> (s,p,o) which size is 10 billions rows. The data type of each column
> is string.  The server has 512G RAM, 32 cores and 14T SSD (RAID 0)

> Only two types of queries:

> select s p o from t where s = param
> select s p o from t where o = param

TBH, this is a pretty silly way to use a SQL database.  Put
the probe values into a temporary table (in batches, perhaps)
and do a join.  The per-row cost of that sort of approach
will be multiple orders of magnitude smaller than a query
per row.

            regards, tom lane



pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: 2 million queries against a table
Next
From: Laurent FAILLIE
Date:
Subject: Re: Clustering solution ?