PostgreSQL, Query is very slow , supports Index Scan DESC and index skip scan operations?

I need to extract a small amount of data,
but the table is very large and has many indexed columns,
which makes the response time too slow

but, i do’nt want create new index.
because, table is not mine

Env

PostgreSQL 13 AWS RDS

Question

if PostgreSQL supports Index Scan DESC operations.
can i use it?

My expectation is that this query could be faster if it used an Index Scan Desc and Index Skip Scan

Query

SELECT
billingYearMonth AS billingYearMonth
, customerId       AS customerId
, childCustomerId  AS childCustomerId
, deptCustomerId   AS deptCustomerId
, cloudSupplyCode  AS cloudSupplyCode
, sum(usage) AS USAGE
FROM
bill_big_table A
WHERE
billingYearMonth     = '202407'
AND cloudSupplyCode  = '05'
AND KEYSORTORDER     = 3
GROUP BY
billingYearMonth
, customerId
, childCustomerId
, deptCustomerId
, cloudSupplyCode
ORDER BY
  billingYearMonth
, customerId
, childCustomerId
, deptCustomerId
, cloudSupplyCode 
OFFSET   0 ROWS
FETCH NEXT 1000 ROWS ONLY

Index columns (Normal)

Order Column Name Condition
1 billingyearmonth =
2 customerid
3 childcustomerid
4 deptcustomerid
5 cloudsupplyinvoiceid
6 cloudsupplyinvoiceitemid
7 keybillingitemid
8 keysortorder =
9 categorycode
10 cloudsupplycode =

raw DATA

INVOICEYM = ‘202407’

keysortorder cloudsupplycode Rows
1 1 114
2 1 177
3 1 579
1 2 1,021
2 2 3,908
3 2 4,179
1 3 13
2 3 13
3 3 13
1 4 12,000
2 4 3,113,648
3 4 18,151,142
1 5 150
2 5 534
3 5 828 wanna this
1 6 3
2 6 3
3 6 3
1 7 3,601
2 7 49,871
3 7 74,491
1 9 381
2 9 2,394
3 9 2,394
1 10 29
2 10 56
3 10 56
1 12 102
2 12 2,505
3 12 3,556

Table rows 339,172,200
Disk Space 412G
Rel Size 189G

EXPLAIN PLAN

Limit  (cost=0.95..106420.59 rows=1000 width=42) (actual time=11842.405..1695652.907 rows=16 loops=1)
  Output: billingyearmonth, customerid, childcustomerid, deptcustomerid, cloudsupplycode, (sum(usage))
  Buffers: shared hit=78 read=1637059
  I/O Timings: read=3288604.358
  ->  GroupAggregate  (cost=0.95..7681370.57 rows=72180 width=42) (actual time=11842.403..1695652.889 rows=16 loops=1)
        Output: billingyearmonth, customerid, childcustomerid, deptcustomerid, cloudsupplycode, sum(usage)
        Group Key: a.billingyearmonth, a.customerid, a.childcustomerid, a.deptcustomerid, a.cloudsupplycode
        Buffers: shared hit=78 read=1637059
        I/O Timings: read=3288604.358
        ->  Index Scan using bill_big_table_pkey on public.bill_big_table a  (cost=0.95..7679565.03 rows=72249 width=42) (actual time=6203.945..1695652.135 rows=828 loops=1)
              Output: billingyearmonth, customerid, childcustomerid, deptcustomerid, cloudsupplyinvoiceid, cloudsupplyinvoiceitemid, cloudsupplyinvoicetype, keybillingitemid, keysortorder, categorycode, cloudsupplycode, categoryname, itemname, pricecurrency, originamount, exchangerate, exchangeratedate, totalkrwamount, billingtype, startdate, enddate, orderuserid, productcode, usage, usageunit, startdate_l, enddate_l, billingentity, tagresourceid, meteringtype
              Index Cond: (((a.billingyearmonth)::text = '202407'::text) AND (a.keysortorder = 3) AND (a.cloudsupplycode = '05'::bpchar))
              Buffers: shared hit=78 read=1637059
              I/O Timings: read=3288604.358
Planning:
  Buffers: shared hit=122 read=12
  I/O Timings: read=11.781
Planning Time: 13.274 ms
Execution Time: 1695653.003 ms

New contributor

BlackOrc is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật