4 ms·
That's interesting. So can you put an index on a TEXT column in PG? From what I know, you can't do that in SQL Server/Oracle, you can only use full text searc
by steven2012 13y ago
That's interesting. So can you put an index on a TEXT column in PG? From what I know, you can't do that in SQL Server/Oracle, you can only use full text searching (I think).
- Jonanin 13y agoYes, indexes behave the same on TEXT columns as they would on CHAR or VARCHAR ones.
- jeltz 13y agoNote however that normal b-tree indexes cannot index column values larger than 8191 bytes. The 8191 byte limit is applied after possible compression of the string.
- masklinn 13y ago> So can you put an index on a TEXT column in PG? Yes, but the default index (btree) will generate an error if you try to insert data above 8k. The hash index will work. Not that it makes much sense to use an index (rather than FTS) on such an amount of data.