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

From Rob Sargent
Subject Re: 2 million queries against a table
Date
Msg-id a13db24b-dd45-b1e5-c2de-2bc8edb810ae@gmail.com
Whole thread Raw
In response to Re: 2 million queries against a table  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general

On 7/15/20 9:38 AM, Tom Lane wrote:
> 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
> 
> 
I had assumed the OP was planning a performance test for say 2M separate 
user/requests (perhaps non-unique) rather than asking for the specific 
2M records.




pgsql-general by date:

Previous
From: Laurent FAILLIE
Date:
Subject: Re: Clustering solution ?
Next
From: Naresh Kumar
Date:
Subject: Re: psql: FATAL: database "postgres" does not exist or ERROR: 23505: duplicate key value violates unique constraint "pg_namespace_nspname_index"