Re: 2 million queries against a table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: 2 million queries against a table
Дата
Msg-id 3077129.1594827537@sss.pgh.pa.us
обсуждение исходный текст
Ответ на 2 million queries against a table  (Adam Sanchez <a.sanchez75@gmail.com>)
Ответы Re: 2 million queries against a table  (Rob Sargent <robjsargent@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Ron
Дата:
Сообщение: Re: 2 million queries against a table
Следующее
От: Laurent FAILLIE
Дата:
Сообщение: Re: Clustering solution ?