Re: Get info about the index

2025-07-29 Thread Igor Korot
On Tue, Jul 29, 2025, 9:24 AM Laurenz Albe wrote: > On Tue, 2025-07-29 at 07:18 -0500, Igor Korot wrote: > > If I have a database for some financial data for the year 2024 in the > > mydb_2024 and I have current year financial data in the mydb_2025 how > > can I compare the data? > > You connect

Re: Get info about the index

2025-07-29 Thread Laurenz Albe
On Tue, 2025-07-29 at 07:18 -0500, Igor Korot wrote: > If I have a database for some financial data for the year 2024 in the > mydb_2024 and I have current year financial data in the mydb_2025 how > can I compare the data? You connect to both and query them both. Alternatively, you use postgres_f

Re: Get info about the index

2025-07-29 Thread Igor Korot
On Tue, Jul 29, 2025 at 7:07 AM Laurenz Albe wrote: > > On Tue, 2025-07-29 at 06:46 -0500, Igor Korot wrote: > > SELECT > > t.relname AS table_name, > > i.relname AS index_name, > > a.attname AS column_name > > FROM > > pg_class t, > > pg_class i, > > pg_index ix, > > p

Re: Get info about the index

2025-07-29 Thread Laurenz Albe
On Tue, 2025-07-29 at 06:46 -0500, Igor Korot wrote: > SELECT >     t.relname AS table_name, >     i.relname AS index_name, >     a.attname AS column_name > FROM >     pg_class t, >     pg_class i, >     pg_index ix, >     pg_attribute a > WHERE >     t.oid = ix.indrelid AND >     i.oid = ix.indexr

Re: Get info about the index

2025-07-29 Thread Igor Korot
Hi, guys, On Mon, Jul 28, 2025 at 10:13 AM Laurenz Albe wrote: > > On Mon, 2025-07-28 at 08:19 -0500, David Barbour wrote: > > Couple of suggestions. You might try ChatGPT. > > Please don't be insulting. He asked for real information. I finally formulate my google request and got this: https:

Re: Get info about the index

2025-07-28 Thread Laurenz Albe
On Mon, 2025-07-28 at 08:19 -0500, David Barbour wrote: > Couple of suggestions.  You might try ChatGPT. Please don't be insulting. He asked for real information. Yours, Laurenz Albe

Re: Get info about the index

2025-07-28 Thread David Barbour
Couple of suggestions. You might try ChatGPT. I've had some success using this tool to uncover improvements to the use of indexes. The other would be to look at https://explain.depesz.com/. It's pretty self-explanatory. You run an explain plan and paste the results into the tool and it will run

Re: Get info about the index

2025-07-26 Thread Jon Zeppieri
On Sat, Jul 26, 2025 at 3:13 PM Igor Korot wrote: > > I didn't find the sorting for the field. > > Can you help? The pg_index_column_has_property() can provide this information. E.g., select pg_index_column_has_property('my_index'::regclass, 2, 'desc');

Re: Get info about the index

2025-07-26 Thread Laurenz Albe
On Sat, 2025-07-26 at 15:13 -0400, Igor Korot wrote: > On Sat, Jul 26, 2025, 2:14 PM Christophe Pettus wrote: > > > I want to know all individual things: > > > - whether the index is unique. > > > - what type of index it is > > > - whether the field is ASC or DESC. > > > - all other individual ara

Re: Get info about the index

2025-07-26 Thread Igor Korot
Hi, Christopher, On Sat, Jul 26, 2025, 2:14 PM Christophe Pettus wrote: > > > > I want to know all individual things: > > - whether the index is unique. > > - what type of index it is > > - whether the field is ASC or DESC. > > - all other individual arams > > pg_index is the source for those.

Re: Get info about the index

2025-07-26 Thread Christophe Pettus
> I want to know all individual things: > - whether the index is unique. > - what type of index it is > - whether the field is ASC or DESC. > - all other individual arams pg_index is the source for those. The one exception is the access method for the index, which is in pg_class.

Re: Get info about the index

2025-07-26 Thread Igor Korot
Adrian, On Sat, Jul 26, 2025 at 11:08 AM Adrian Klaver wrote: > > On 7/26/25 08:00, Igor Korot wrote: > > Hi, ALL, > > Is there a better place to get the info about the index other than > > https://www.postgresql.org/docs/current/view-pg-indexes.html > > What information do you need? This is the

Re: Get info about the index

2025-07-26 Thread Tom Lane
Adrian Klaver writes: > On 7/26/25 08:00, Igor Korot wrote: >> Is there a better place to get the info about the index other than >> https://www.postgresql.org/docs/current/view-pg-indexes.html > pg_class: > https://www.postgresql.org/docs/current/catalog-pg-class.html > and pg_attribute: > https

Re: Get info about the index

2025-07-26 Thread Adrian Klaver
On 7/26/25 08:00, Igor Korot wrote: Hi, ALL, Is there a better place to get the info about the index other than https://www.postgresql.org/docs/current/view-pg-indexes.html That guy has a full blown CREATE INDEX command and I will need to parse it to get the info I need. FYI, pg_class: https

Re: Get info about the index

2025-07-26 Thread David G. Johnston
On Sat, Jul 26, 2025, 08:00 Igor Korot wrote: > Hi, ALL, > Is there a better place to get the info about the index other than > https://www.postgresql.org/docs/current/view-pg-indexes.html > > That guy has a full blown CREATE INDEX command and I will need to > parse it to get the info I need. >

Re: Get info about the index

2025-07-26 Thread Robert Sjöblom
On Sat, 26 Jul 2025, 17:00 Igor Korot, wrote: > Hi, ALL, > Is there a better place to get the info about the index other than > https://www.postgresql.org/docs/current/view-pg-indexes.html > > That guy has a full blown CREATE INDEX command and I will need to > parse it to get the info I need. > >

Re: Get info about the index

2025-07-26 Thread Adrian Klaver
On 7/26/25 08:00, Igor Korot wrote: Hi, ALL, Is there a better place to get the info about the index other than https://www.postgresql.org/docs/current/view-pg-indexes.html What information do you need? That guy has a full blown CREATE INDEX command and I will need to parse it to get the inf