bullet icon indicating copy to clipboard operation
bullet copied to clipboard

False positives

Open aximuseng opened this issue 5 years ago • 3 comments

Bullet is reporting this on my index page:

USE eager loading detected
  Budget => [:client]
  Add to your finder: :includes => [:client]

USE eager loading detected
  Expenditure => [:project]
  Add to your finder: :includes => [:project]
USE eager loading detected
  Expenditure => [:vendor]
  Add to your finder: :includes => [:vendor]
USE eager loading detected
  Expenditure => [:budget]
  Add to your finder: :includes => [:budget]

The thing is I have all these includes already added:

Expenditure.includes(:vendor, :budget)
Expenditure.includes(:budget, :vendor, :project)
Budget.includes(:client)

The if I add :projects to the first include I then get:

AVOID eager loading detected
  Budget => [:project]
  Remove from your finder: :includes => [:project]

For some background Expenditures belong to Budget and can have a vendor. Budget belongs to Project and Projects belong to Client.

I am either missing some nested includes here of these are false positives.

aximuseng avatar Jul 02 '19 16:07 aximuseng

I can confirm this. Running Bullet 6.0.1 on Rails 5.2.3.

Puma starting in single mode...
* Version 4.0.1 (ruby 2.5.5-p157), codename: 4 Fast 4 Furious
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000

My Products can have many Keywords through a join table. The Products model already includes has_many :keywords, through: :product_keywords.

The query

    @products = Product.includes(:product_type,
                                 :language,
                                 :authors,
                                 :keywords,
                                 :article,
                                 :book_part,
                                 :book,
                                 :disciplines)

triggers

F, [2019-08-03T16:01:02.159857 #14632] FATAL -- : [8d806a37-74c9-4870-9ea9-be2e8c65eef9] Bullet::Notification::UnoptimizedQueryError (user: <snip>
GET /disciplina/38/producto
USE eager loading detected
  Product => [:product_keywords]
  Add to your finder: :includes => [:product_keywords]
Call stack
  c:/Users/<snip>/app/controllers/product_controller.rb:64:in `index'

):

amyspark avatar Aug 03 '19 19:08 amyspark

Same situation here: Bullet 6.0.2 and Rails 5.0.7.2 :(

jotolo avatar Jan 09 '20 08:01 jotolo

Still the same. Bullet 7.0.7 and Rails 7.0.5

jnsntm avatar Sep 14 '23 09:09 jnsntm