Re: Postgres 15 SELECT query doesn't use index under RLS

Поиск
Список
Период
Сортировка
От Alexander Okulovich
Тема Re: Postgres 15 SELECT query doesn't use index under RLS
Дата
Msg-id e9d503cb-efeb-43d3-952e-f517e4d24302@stiltsoft.com
обсуждение исходный текст
Ответ на Re: Postgres 15 SELECT query doesn't use index under RLS  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Postgres 15 SELECT query doesn't use index under RLS  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance

Hi Tom,

I've attempted to reproduce this on my PC in Docker from the stage database dump, but no luck. The first query execution on Postgres 15 behaves like on the real stage, but subsequent ones use the index. Also, they execute much faster. Looks like the hardware and(or) the data structure on disk matters.

Here is the Docker Compose sample config:

version: '2.4'

services:
database-15:  image: postgres:15.4  ports:    - "7300:5432"
  environment:    POSTGRES_DB: stage_db    POSTGRES_USER: stage    POSTGRES_PASSWORD: stage  volumes:    - "./init.sql:/docker-entrypoint-initdb.d/init.sql"
    - "./pgdb/aws-15:/var/lib/postgresql/data"
  mem_limit: 512M  cpus: 2  blkio_config:    device_read_bps:      - path: /dev/nvme0n1        rate: '10mb'
    device_read_iops:        - path: /dev/nvme0n1          rate: 2000    device_write_bps:        - path: /dev/nvme0n1          rate: '10mb'
    device_write_iops:        - path: /dev/nvme0n1          rate: 2000
I performed tests only with CPU and memory limits. If I try to limit the disk(blkio_config), my system hangs on container startup after a while.
Could you please share your thoughts on how to create such a self-contained test case.

Kind regards,

Alexander

On 18.10.2023 22:35, Tom Lane wrote:
If you could provide a self-contained test case that performs 10x worse under v15 than v12, we'd surely take a look at it. But with the information you've given so far, little is possible beyond speculation.

В списке pgsql-performance по дате отправления:

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: GIN JSONB path index is not always used
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Postgres 15 SELECT query doesn't use index under RLS