PostgreSQL supports several index types, each optimized for different kinds of queries and data structures. Here’s a breakdown:

1. B-tree (Default)

Use for: Equality and range queries (=, <, >, BETWEEN, ORDER BY)

Best for: Most use cases (numeric, text, date/time)

Limitations: Not ideal for arrays, full-text, or geometric data

2. GIN (Generalized Inverted Index)

Use for: Multi-valued columns (arrays, jsonb, full-text search)

Best for: Full-text search (to_tsvector, @@), jsonb containment (@>), array matching

Limitations: Slower to write, larger index size

3. GiST (Generalized Search Tree)

Use for: Range types, geometric types, custom data types

Best for:

• Spatial data (point, polygon, box)

• Fuzzy text search (via pg_trgm)

• Full-text search (alternative to GIN)

Customizable: You can define your own GiST operator classes

4. SP-GiST (Space-partitioned GiST)

Use for: Spatial or hierarchical partitioned data

Best for: Data that can be divided (e.g., quadtrees, tries)

Use case: IP address lookups, phone directories, routing

5. BRIN (Block Range Index)

Use for: Very large tables where data is naturally ordered

Best for: Time-series, log tables, append-only data

Mechanism: Stores min/max values per block instead of every row

Super lightweight, but approximate → ideal for big data

6. Hash

Use for: Equality (=) comparisons only

Best for: When you need fast exact-match lookups

Caveats:

• Rarely used

• Not WAL-logged before PostgreSQL 10

• B-tree is often faster and more versatile

7. Expression Indexes

• Indexes on computed expressions:

CREATE INDEX idx_lower_name ON users (LOWER(name));

8. Partial Indexes

• Indexes only a subset of rows:

CREATE INDEX idx_active_users ON users (email) WHERE is_active = true;

Summary Table

Index Type Best For Examples

B-tree General purpose =, <, BETWEEN

GIN Full-text, JSONB, arrays @@, @>, ?

GiST Spatial, custom search pg_trgm, cube, geometric

SP-GiST Tree/partitioned data Prefix trees, ranges

BRIN Large, ordered data Timestamps, logs

Hash Exact matches WHERE id = 5

Partial Subsets WHERE active = true

Expression Transformed values LOWER(col)

Hara Bhara Kabab

Spinach and peas patties lightly spiced and grilled.

Price: $6.99

Chicken 65

South Indian-style spicy fried chicken nuggets.

Price: $8.99

Tandoori Mushroom

Button mushrooms marinated in tikka spices and grilled.

Price: $7.99

Tandoori Chicken

Bone-in chicken marinated and roasted in tandoor.

Price: $11.99

Paneer Lababdar

Cottage cheese in tangy tomato and creamy onion gravy.

Price: $11.49

Chicken Tikka Masala

Grilled chicken chunks in creamy spiced masala sauce.

Price: $12.49

Lamb Korma

Lamb cooked in rich yogurt-cashew gravy.

Price: $13.99

Fish Curry (Kerala Style)

Coconut milk-based curry with tangy tamarind and spices.

Price: $12.99

Mutton Biryani

Layered rice and marinated mutton, slow-cooked to perfection.

Price: $13.99

Veg Fried Rice

Sautéed rice with vegetables and Indo-Chinese flavor.

Price: $8.49

Lachha Paratha

Flaky, layered flatbread cooked in tandoor.

Price: $2.99

Paneer Paratha

Whole wheat flatbread stuffed with spiced paneer.

Price: $4.49

Pav Bhaji

Mumbai-style mashed vegetable curry served with buttered buns.

Price: $7.49

Pani Puri

Crispy puris filled with spicy and tangy water, potato & chickpeas.

Price: $5.99

Masala Dosa

Crispy crepe stuffed with potato masala and served with chutney.

Price: $7.99

Medu Vada

Crisp fried urad dal doughnuts served with sambhar.

Price: $5.49

Sweet Lassi

Thick yogurt drink sweetened and topped with cream.

Price: $3.99

Filter Coffee

Authentic South Indian filter coffee with strong decoction.

Price: $2.49

Jalebi

Deep-fried flour spirals soaked in saffron sugar syrup.

Price: $3.99

Malai Kulfi

Creamy frozen dessert flavored with cardamom and nuts.

Price: $3.99

Deluxe Veg Thali

Includes 3 curries, rice, bread, sweet, raita, pickle, and papad.

Royal Non-Veg Thali

Includes chicken curry, lamb curry, biryani, bread, dessert.

Test chutney

Price: $0.10

Leave a Reply

Your email address will not be published. Required fields are marked *