@@ -86,8 +86,8 @@ test("GIN: basic @> containment recommends GIN with jsonb_path_ops", async () =>
8686 reltuples : 100_000 ,
8787 relallvisible : 1 ,
8888 columns : [
89- { columnName : "id" , stats : null } ,
90- { columnName : "data" , stats : null } ,
89+ { columnName : "id" , stats : null , attlen : 8 } ,
90+ { columnName : "data" , stats : null , attlen : null } ,
9191 ] ,
9292 indexes : [ ] ,
9393 } ] ,
@@ -171,8 +171,8 @@ test("GIN: key existence (?) recommends GIN with default jsonb_ops", async () =>
171171 reltuples : 100_000 ,
172172 relallvisible : 1 ,
173173 columns : [
174- { columnName : "id" , stats : null } ,
175- { columnName : "payload" , stats : null } ,
174+ { columnName : "id" , stats : null , attlen : 8 } ,
175+ { columnName : "payload" , stats : null , attlen : null } ,
176176 ] ,
177177 indexes : [ ] ,
178178 } ] ,
@@ -258,8 +258,8 @@ test("GIN: any-key existence (?|) recommends GIN with default jsonb_ops", async
258258 reltuples : 100_000 ,
259259 relallvisible : 1 ,
260260 columns : [
261- { columnName : "id" , stats : null } ,
262- { columnName : "payload" , stats : null } ,
261+ { columnName : "id" , stats : null , attlen : 8 } ,
262+ { columnName : "payload" , stats : null , attlen : null } ,
263263 ] ,
264264 indexes : [ ] ,
265265 } ] ,
@@ -342,8 +342,8 @@ test("GIN: all-keys existence (?&) recommends GIN with default jsonb_ops", async
342342 reltuples : 100_000 ,
343343 relallvisible : 1 ,
344344 columns : [
345- { columnName : "id" , stats : null } ,
346- { columnName : "payload" , stats : null } ,
345+ { columnName : "id" , stats : null , attlen : 8 } ,
346+ { columnName : "payload" , stats : null , attlen : null } ,
347347 ] ,
348348 indexes : [ ] ,
349349 } ] ,
@@ -428,9 +428,9 @@ test("GIN: mixed JSONB and regular column produces both GIN and B-tree", async (
428428 reltuples : 100_000 ,
429429 relallvisible : 1 ,
430430 columns : [
431- { columnName : "id" , stats : null } ,
432- { columnName : "data" , stats : null } ,
433- { columnName : "price" , stats : null } ,
431+ { columnName : "id" , stats : null , attlen : 8 } ,
432+ { columnName : "data" , stats : null , attlen : null } ,
433+ { columnName : "price" , stats : null , attlen : 8 } ,
434434 ] ,
435435 indexes : [ ] ,
436436 } ] ,
@@ -536,8 +536,8 @@ test("GIN: mixed @> and ? on same column escalates to jsonb_ops", async () => {
536536 reltuples : 100_000 ,
537537 relallvisible : 1 ,
538538 columns : [
539- { columnName : "id" , stats : null } ,
540- { columnName : "data" , stats : null } ,
539+ { columnName : "id" , stats : null , attlen : 8 } ,
540+ { columnName : "data" , stats : null , attlen : null } ,
541541 ] ,
542542 indexes : [ ] ,
543543 } ] ,
@@ -626,8 +626,8 @@ test("GIN: table alias resolves to correct table for GIN recommendation", async
626626 reltuples : 100_000 ,
627627 relallvisible : 1 ,
628628 columns : [
629- { columnName : "id" , stats : null } ,
630- { columnName : "data" , stats : null } ,
629+ { columnName : "id" , stats : null , attlen : 8 } ,
630+ { columnName : "data" , stats : null , attlen : null } ,
631631 ] ,
632632 indexes : [ ] ,
633633 } ] ,
@@ -710,8 +710,8 @@ test("GIN: non-JSONB query produces B-tree only, no GIN", async () => {
710710 reltuples : 100_000 ,
711711 relallvisible : 1 ,
712712 columns : [
713- { columnName : "id" , stats : null } ,
714- { columnName : "name" , stats : null } ,
713+ { columnName : "id" , stats : null , attlen : 8 } ,
714+ { columnName : "name" , stats : null , attlen : 20 } ,
715715 ] ,
716716 indexes : [ ] ,
717717 } ] ,
@@ -802,14 +802,17 @@ test("GIN: existing GIN index prevents duplicate recommendation", async () => {
802802 reltuples : 100_000 ,
803803 relallvisible : 1 ,
804804 columns : [
805- { columnName : "id" , stats : null } ,
806- { columnName : "data" , stats : null } ,
805+ { columnName : "id" , stats : null , attlen : 8 } ,
806+ { columnName : "data" , stats : null , attlen : null } ,
807807 ] ,
808808 indexes : [ {
809809 indexName : "idx_products_data" ,
810810 relpages : 50 ,
811811 reltuples : 100_000 ,
812812 relallvisible : 1 ,
813+ amname : "gin" ,
814+ columns : [ { attlen : null } ] ,
815+ fillfactor : 0.9
813816 } ] ,
814817 } ] ,
815818 } ) ;
0 commit comments