Re: Multi-column index: Which column order

2023-02-15 Thread Ron
On 2/15/23 21:45, Laurenz Albe wrote: On Wed, 2023-02-15 at 10:20 -0600, Ron wrote: On 2/15/23 02:46, Laurenz Albe wrote: [snip] Both are the same. There is an old myth that says that you should use the more selective column first (which would be "code"), but that is just a myth. Only on Pos

Re: Multi-column index: Which column order

2023-02-15 Thread Laurenz Albe
On Wed, 2023-02-15 at 10:20 -0600, Ron wrote: > On 2/15/23 02:46, Laurenz Albe wrote: > > Which one is best? > > > CREATE UNIQUE INDEX ix1 ON art (code, etb) > > > or > > > CREATE UNIQUE INDEX ix1 ON art (etb, code) > > > > > > (or its PRIMARY KEY equivalent) > > Both are the same. > > > > There

Re: Multi-column index: Which column order

2023-02-15 Thread Ron
On 2/15/23 02:46, Laurenz Albe wrote: [snip] Which one is best? CREATE UNIQUE INDEX ix1 ON art (code, etb) or CREATE UNIQUE INDEX ix1 ON art (etb, code) (or its PRIMARY KEY equivalent) Both are the same. There is an old myth that says that you should use the moew selective column first (whic

Re: Query plan for "id IS NULL" on PK

2023-02-15 Thread Ron
On 2/14/23 18:21, David Rowley wrote: [snip] since it likely only applies to nearly zero real-world cases Are you sure? -- Born in Arizona, moved to Babylonia.

Re: unresolved external symbol when building on Windows

2023-02-15 Thread Andy Y
Problem resolved. It is due to library machine type conflict: x64 vs x86. On Wed, Feb 15, 2023 at 6:00 PM King of Hearts wrote: > I got a bunch of errors like below when building from source on Windows. > My python version is 3.11. No change if I switch to 3.9. Would > appreciate any pointer. --

unresolved external symbol when building on Windows

2023-02-15 Thread King of Hearts
I got a bunch of errors like below when building from source on Windows. My python version is 3.11. No change if I switch to 3.9. Would appreciate any pointer. -- Andy "C:\Users\test\source\repos\postgresql\pgsql.sln" (default target) (1) -> "C:\Users\test\source\repos\postgresql\plpython3.vcxproj

Re: Multi-column index: Which column order

2023-02-15 Thread Laurenz Albe
On Tue, 2023-02-14 at 17:53 +, Sebastien Flaesch wrote: > When creating an index on multiple columns, does the order of the columns > matter? > (I guess so) It does, but not in your case. > It's mostly for SELECT statements using a condition that include ALL columns > of the index (pkey): >