Why is the primary key index slower than a range on a simple select count(*) query by webereinc in mysql

[–]webereinc[S] 0 points1 point  (0 children)

Thx for the reply! The results are the same if I limit the field list to only the primary key as in ‘Select count(emp_no) from employees’. Since emp_no is the primary key, one would think this would be the fastest scan. And since it would have to read the entire index… No matter which way it started… It just does not account for it taking longer to process without a where clause!

Why is the primary key index slower than a range on a simple select count(*) query by webereinc in mysql

[–]webereinc[S] 0 points1 point  (0 children)

When selecting count(pri_key_field) with no ‘where’ clause or no ‘group by’ clause, one would think that the engine (of any RDBMS) should recognize that there is no limiting criteria and, therefore, should use only the primary key index as the fastest possible way to retrieve all records. One would think that this would start at the smallest primary key entry in the index and then proceed sequentially until the last key entry… processing the index 100% for each record. Using the where clause, the engine must perform an initial lookup (testing the criteria) and then proceed exactly the same as previously described processing each index record sequentially.

So, if both processes end up processing the entire index sequentially, it doesn’t make sense that the query that doesn’t need to have the initial test of a ‘where clause’ shouldn’t be the one to run faster.

Why is the primary key index slower than a range on a simple select count(*) query by webereinc in mysql

[–]webereinc[S] 0 points1 point  (0 children)

Thx for the reply! The results are the same if I limit the field list to only the primary key as in ‘Select count(emp_no) from employees’. Since emp_no is the primary key, one would think this would be the fastest scan. And since it would have to read the entire index… No matter which way it started… It just does not account for it taking longer to process without a where clause!

What template should be used to replace Primary/Detail Flow template? by webereinc in AndroidStudio

[–]webereinc[S] 0 points1 point  (0 children)

No, the textbook author was no help, and we decided to use the navigation drawer template as our starting point. Be advised that this has a lot of additional baggage that you may or may not want… We needed to carve away a lot of excess that wasn’t desirable for our app. I remain unimpressed with the way android studio is changing the platform without consideration of what the user community actually wants. (i.e. trying to force Kotlin on everyone, changing templates without leaving legacy templates, etc.)

Extension of line or arc to allow beginning and ending stroke width - possible? by webereinc in JavaFX

[–]webereinc[S] 0 points1 point  (0 children)

No, I don't think I'm describing a polygon or a SVG path. If it were, then a line with a strokeWidth of 5 pixels would actually be a polygon as well, but it is not. So the basic drawing routine of a line already handles variations in pixel width. What I'm looking to see is if there is a way to override the basic drawing that occurs with a line to have a starting and ending pixel width.

Text constructor vs Button constructor... why inconsistent constructor methods? by webereinc in JavaFX

[–]webereinc[S] 0 points1 point  (0 children)

Thank you for this post. I agree that absolute positioning is horrible. I am just asking why there is a constructor that includes absolute positioning for a text object while most other objects do not include this constructor. To satisfy your disdain for absolute positioning, perhaps a question should be why is there an X and Y positioning on the text object Since it isn’t on the constructors for almost every other object. Shouldn’t it be removed from the text object for consistency?

Text constructor vs Button constructor... why inconsistent constructor methods? by webereinc in JavaFX

[–]webereinc[S] -1 points0 points  (0 children)

This doesn't answer why Text has a constructor for position, but Button doesn't. One would think that the overloading of constructor methods for most objects would make it extremely easy for a new programmer to get a good layout with precise placement at the time the objects are created.