Re: Index problem Need an urgent fix
hi, Le ven. 3 févr. 2023 à 11:33, chanukya SDS a écrit : > Hey All, > > I have a query like below > > > SELECT * FROM data WHERE val=trunc(val) AND > acc_id='kfd50ed6-0bc3-44a9-881f-ec89713fdd80'::uuid ORDER BY ct DESC LIMIT > 10; > > table structure is > > data > (id uuid, > c_id uuid, > acc_id uuid, > val numeric, > ct timestamptz); > > > Can you please help me to write an index? > > or Can someone write an index and revert here.. > > its very urgent for me. > pgsql-hackers isn't a suitable mailing list for this question, you should use psql-general or psql-performance. please also look at https://wiki.postgresql.org/wiki/Slow_Query_Questions for details to provide. note that if you're not really sure of what index would help and don't want to disturb your database too much (and assuming you don't have another environment to test things on), you can use hypopg to create hypothetical indexes and see how many index definitions would behave without actually creating them: https://github.com/HypoPG/hypopg >
Re: Index problem Need an urgent fix
On Fri, Feb 3, 2023 at 9:03 AM chanukya SDS wrote: > > Hey All, > > I have a query like below > > SELECT * FROM data WHERE val=trunc(val) AND > acc_id='kfd50ed6-0bc3-44a9-881f-ec89713fdd80'::uuid ORDER BY ct DESC LIMIT 10; > > table structure is > > data > (id uuid, > c_id uuid, > acc_id uuid, > val numeric, > ct timestamptz); > > Can you please help me to write an index? > > or Can someone write an index and revert here.. > > its very urgent for me. Thanks for reaching out. I think the question is more generic without the problem being described. Is the SELECT query taking more time? If yes, why? Have you looked at EXPLAIN (ANALYZE...) output? Have you tried to tune/vary configuration settings to see if it helps? Also, the best place to ask this question is pgsql-general or pgsql-sql. -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com
Index problem Need an urgent fix
Hey All, I have a query like below SELECT * FROM data WHERE val=trunc(val) AND acc_id='kfd50ed6-0bc3-44a9-881f-ec89713fdd80'::uuid ORDER BY ct DESC LIMIT 10; table structure is data (id uuid, c_id uuid, acc_id uuid, val numeric, ct timestamptz); Can you please help me to write an index? or Can someone write an index and revert here.. its very urgent for me. Thanks -- Thanks, Chanukya SDS +918186868384 Sent From My iPhone