PgHero
SELECT     id,name,rc_code,item_subtype_id FROM       "items"  WHERE     ("items"."is_consignment" = $1) AND (id in(select iwd.item_id from inventory_statuses as iss inner join item_with_details as iwd on iss.item_with_detail_id=iwd.id where iss.quantity > $2 and iss.inventory_head_id=$3 and iss.flag=$4 and (iwd.expiry_date >= $5 or iwd.expiry_date is null)) and is_asset = $6 and is_consignment = $7 and status = $8) ORDER BY  name, lower(name)

Total Time ms

Loading...

Average Time ms

Loading...

Calls

Loading...

Tables

Name Rows Indexes
inventory_statuses 1557846
  • id PRIMARY
  • created_at
  • created_by
  • flag
  • inventory_head_id
  • item_with_detail_id
  • mg_status
  • quantity
  • status
  • updated_at
  • updated_by
item_with_details 337788
  • id PRIMARY
  • actual_cost_price
  • batch_number
  • cost_price
  • created_at
  • created_by
  • dc_date
  • dc_no
  • discount_percentage
  • effective_cost_price
  • expiry_date
  • fare_market_value
  • general_account_id
  • item_id
  • manufacture_date
  • manufacturer_id
  • mg_status
  • mrp
  • output_tax_profile_id
  • purchase_expense_amount
  • reference1
  • selling_price
  • status
  • supplier_id
  • tax_amount
  • tax_on_flag
  • tax_profile_id
  • updated_at
  • updated_by
items 28566
  • id PRIMARY
  • dispensing_unit_id
  • expiry_date_present
  • generic_name
  • is_asset
  • is_consignment
  • item_subtype_id
  • name
  • name gist_trgm_ops GIST
  • rc_code
  • status