Like everything else, it seems PostgreSQL has much more powerful/complex indexing for tables. Perhaps someone can help me to know the default way to index columns.
By default I mean integer/boolean columns which are used 90% of the time to filter table results.
In MySQL I would simply create an index on a column with the same name as that column. I’m not sure what type was used (btree?) or what the implications of naming the index the same thing as the column were – but it worked.
Now moving to PostgreSQL I’m wondering if there is any problem naming the index with the same name (or any reason not too). Also, I’m wondering which type of index should be used for int/bool values.
For the most part the default index type (btree) will be fine.
The default index name (if you don’t specify one in the CREATE INDEX statement) is based on the table and column name, typically something like table_column_idx. IIRC index names must be unique within a schema, so if you name your indexes with the same name as the columns you may run into trouble if the same column name is used in more than one table in the schema.